* use c++11 fixed width integer types in jeeps.
thanks resharper!
* fix fixed width integers resharper missed.
in non windows code.
--- /dev/null
+{\r
+ "configurations": [\r
+ {\r
+ "name": "x64-Debug",\r
+ "generator": "Ninja",\r
+ "configurationType": "Debug",\r
+ "inheritEnvironments": [ "msvc_x64_x64" ],\r
+ "buildRoot": "${projectDir}\\out\\build\\${name}",\r
+ "installRoot": "${projectDir}\\out\\install\\${name}",\r
+ "cmakeCommandArgs": "-DCMAKE_PREFIX_PATH=C:/Qt/6.5.3/msvc2019_64",\r
+ "buildCommandArgs": "",\r
+ "ctestCommandArgs": ""\r
+ },\r
+ {\r
+ "name": "x64-Clang-Debug",\r
+ "generator": "Ninja",\r
+ "configurationType": "Debug",\r
+ "buildRoot": "${projectDir}\\out\\build\\${name}",\r
+ "installRoot": "${projectDir}\\out\\install\\${name}",\r
+ "cmakeCommandArgs": "-DCMAKE_PREFIX_PATH=C:/Qt/6.5.3/msvc2019_64 -DCMAKE_VERBOSE_MAKEFILE=ON",\r
+ "buildCommandArgs": "",\r
+ "ctestCommandArgs": "",\r
+ "inheritEnvironments": [ "clang_cl_x64_x64" ]\r
+ }\r
+ ]\r
+}
\ No newline at end of file
}
- int32 ntracks = GPS_Command_Get_Track(portname, &array, waypt_read_cb);
+ int32_t ntracks = GPS_Command_Get_Track(portname, &array, waypt_read_cb);
if (ntracks <= 0) {
return;
*/
route_head* rte_head = nullptr;
- int32 nroutepts = GPS_Command_Get_Route(portname, &array);
+ int32_t nroutepts = GPS_Command_Get_Route(portname, &array);
// fprintf(stderr, "Routes %d\n", (int) nroutepts);
#if 1
{
int n = waypoint_prepare();
- if (int32 ret = GPS_Command_Send_Waypoint(portname, tx_waylist, n, waypt_write_cb); ret < 0) {
+ if (int32_t ret = GPS_Command_Send_Waypoint(portname, tx_waylist, n, waypt_write_cb); ret < 0) {
fatal(MYNAME ":communication error sending waypoints..\n");
}
static int
track_prepare()
{
- int32 n = track_waypt_count() + track_count();
+ int32_t n = track_waypt_count() + track_count();
tx_tracklist = (GPS_STrack**) xcalloc(n, sizeof(GPS_PTrack));
cur_tx_tracklist_entry = tx_tracklist;
#define ETX 0x03
-extern int32 gps_errno;
-extern int32 gps_warning;
-extern int32 gps_error;
-extern int32 gps_user;
-extern int32 gps_show_bytes;
+extern int32_t gps_errno;
+extern int32_t gps_warning;
+extern int32_t gps_error;
+extern int32_t gps_user;
+extern int32_t gps_show_bytes;
extern char gps_categories[16][17];
struct GPS_Packet {
US type{0};
- uint32 n{0};
+ uint32_t n{0};
UC data[MAX_GPS_PACKET_SIZE]{};
};
float epe;
float eph;
float epv;
- int16 fix;
+ int16_t fix;
double tow;
double lat;
double lon;
float north;
float up;
float msl_hght;
- int16 leap_scnds;
- int32 wn_days;
+ int16_t leap_scnds;
+ int32_t wn_days;
} GPS_OPvt_Data, *GPS_PPvt_Data;
unsigned int tnew:1; /* New track? */
unsigned int ishdr:1; /* Track header? */
unsigned int no_latlon:1; /* True if no valid lat/lon found. */
- int32 dspl; /* Display on map? */
- int32 colour; /* Colour */
+ int32_t dspl; /* Display on map? */
+ int32_t colour; /* Colour */
float distance; /* distance traveled in meters.*/
int distance_populated; /* True if above is valid. */
char trk_ident[256]; /* Track identifier */
typedef struct GPS_SAlmanac {
UC svid;
- int16 wn;
+ int16_t wn;
float toa;
float af0;
float af1;
double lon;
char cmnt[256];
float dst;
- int32 smbl;
- int32 dspl;
+ int32_t smbl;
+ int32_t dspl;
char wpt_ident[256];
char lnk_ident[256];
UC subclass[18];
- int32 colour;
+ int32_t colour;
char cc[2];
UC wpt_class;
UC alt_is_unknown;
char facility[32];
char addr[52];
char cross_road[52];
- int32 attr;
+ int32_t attr;
float dpth;
- int32 idx;
- int32 prot;
- int32 isrte;
- int32 rte_prot;
+ int32_t idx;
+ int32_t prot;
+ int32_t isrte;
+ int32_t rte_prot;
UC rte_num;
char rte_cmnt[20];
char rte_ident[256];
- int32 islink;
- int32 rte_link_class;
+ int32_t islink;
+ int32_t rte_link_class;
char rte_link_subclass[18];
char rte_link_ident[256];
time_t time; /* Unix time */
char temperature_populated;
float temperature; /* Degrees celsius. */
- uint16 category;
+ uint16_t category;
} GPS_OWay, *GPS_PWay;
* Forerunner/Edge Lap data.
*/
typedef struct GPS_SLap {
- uint32 index; /* unique index in device or -1 */
+ uint32_t index; /* unique index in device or -1 */
time_t start_time;
- uint32 total_time; /* Hundredths of a second */
+ uint32_t total_time; /* Hundredths of a second */
float total_distance; /* In meters */
double begin_lat;
double begin_lon;
double end_lat;
double end_lon;
- int16 calories;
- uint32 track_index; /* ref to track or -1 */
+ int16_t calories;
+ uint32_t track_index; /* ref to track or -1 */
float max_speed; /* In meters per second */
unsigned char avg_heart_rate; /* In beats-per-minute, 0 if invalid */
unsigned char max_heart_rate; /* In beats-per-minute, 0 if invalid */
typedef struct GPS_SCourse {
- uint32 index; /* Unique among courses on device */
+ uint32_t index; /* Unique among courses on device */
char course_name[16]; /* Null-terminated unique course name */
- uint32 track_index; /* Index of the associated track
+ uint32_t track_index; /* Index of the associated track
* Must be 0xFFFFFFFF if there is none*/
} GPS_OCourse, *GPS_PCourse;
typedef struct GPS_SCourse_Lap {
- uint32 course_index; /* Index of associated course */
- uint32 lap_index; /* This lap's index in the course */
- uint32 total_time; /* In hundredths of a second */
+ uint32_t course_index; /* Index of associated course */
+ uint32_t lap_index; /* This lap's index in the course */
+ uint32_t total_time; /* In hundredths of a second */
float total_dist; /* [m] */
double begin_lat; /* Starting position of the lap */
double begin_lon; /* Invalid if lat,lon are 0x7FFFFFFF.*/
typedef struct GPS_SCourse_Point {
char name[11]; /* Null-terminated name */
- uint32 course_index; /* Index of associated course */
+ uint32_t course_index; /* Index of associated course */
time_t track_point_time; /* Time */
UC point_type; /* generic = 0,
* summit = 1,
} GPS_OCourse_Point, *GPS_PCourse_Point;
typedef struct GPS_SCourse_Limits {
- int32 max_courses;
- int32 max_course_laps;
- int32 max_course_pnt;
- int32 max_course_trk_pnt;
+ int32_t max_courses;
+ int32_t max_course_laps;
+ int32_t max_course_pnt;
+ int32_t max_course_trk_pnt;
} GPS_OCourse_Limits, *GPS_PCourse_Limits;
extern time_t gps_save_time;
extern double gps_save_lat;
extern double gps_save_lon;
-extern int32 gps_save_id;
+extern int32_t gps_save_id;
extern double gps_save_version;
extern char gps_save_string[GPS_ARB_LEN];
extern int gps_is_usb;
#define XMIN(a,b) (a < b? a : b)
-static int32 GPS_A000(const char* port);
+static int32_t GPS_A000(const char* port);
static void GPS_A001(const GPS_Packet& packet);
static void GPS_D154_Get(GPS_PWay* way, UC* s);
static void GPS_D155_Get(GPS_PWay* way, UC* s);
-static void GPS_D100_Send(UC* data, GPS_PWay way, int32* len);
-static void GPS_D101_Send(UC* data, GPS_PWay way, int32* len);
-static void GPS_D102_Send(UC* data, GPS_PWay way, int32* len);
-static void GPS_D103_Send(UC* data, GPS_PWay way, int32* len);
-static void GPS_D104_Send(UC* data, GPS_PWay way, int32* len);
-static void GPS_D105_Send(UC* data, GPS_PWay way, int32* len);
-static void GPS_D106_Send(UC* data, GPS_PWay way, int32* len);
-static void GPS_D107_Send(UC* data, GPS_PWay way, int32* len);
-static void GPS_D108_Send(UC* data, GPS_PWay way, int32* len);
-static void GPS_D109_Send(UC* data, GPS_PWay way, int32* len, int protoid);
-static void GPS_D150_Send(UC* data, GPS_PWay way, int32* len);
-static void GPS_D151_Send(UC* data, GPS_PWay way, int32* len);
-static void GPS_D152_Send(UC* data, GPS_PWay way, int32* len);
-static void GPS_D154_Send(UC* data, GPS_PWay way, int32* len);
-static void GPS_D155_Send(UC* data, GPS_PWay way, int32* len);
+static void GPS_D100_Send(UC* data, GPS_PWay way, int32_t* len);
+static void GPS_D101_Send(UC* data, GPS_PWay way, int32_t* len);
+static void GPS_D102_Send(UC* data, GPS_PWay way, int32_t* len);
+static void GPS_D103_Send(UC* data, GPS_PWay way, int32_t* len);
+static void GPS_D104_Send(UC* data, GPS_PWay way, int32_t* len);
+static void GPS_D105_Send(UC* data, GPS_PWay way, int32_t* len);
+static void GPS_D106_Send(UC* data, GPS_PWay way, int32_t* len);
+static void GPS_D107_Send(UC* data, GPS_PWay way, int32_t* len);
+static void GPS_D108_Send(UC* data, GPS_PWay way, int32_t* len);
+static void GPS_D109_Send(UC* data, GPS_PWay way, int32_t* len, int protoid);
+static void GPS_D150_Send(UC* data, GPS_PWay way, int32_t* len);
+static void GPS_D151_Send(UC* data, GPS_PWay way, int32_t* len);
+static void GPS_D152_Send(UC* data, GPS_PWay way, int32_t* len);
+static void GPS_D154_Send(UC* data, GPS_PWay way, int32_t* len);
+static void GPS_D155_Send(UC* data, GPS_PWay way, int32_t* len);
static void GPS_D120_Get(int cat_num, char*s);
static void GPS_D201_Get(GPS_PWay* way, UC* s);
static void GPS_D202_Get(GPS_PWay* way, UC* s);
static void GPS_D210_Get(GPS_PWay* way, UC* s);
-static void GPS_D200_Send(UC* data, GPS_PWay way, int32* len);
-static void GPS_D201_Send(UC* data, GPS_PWay way, int32* len);
-static void GPS_D202_Send(UC* data, GPS_PWay way, int32* len);
-static void GPS_D210_Send(UC* data, GPS_PWay way, int32* len);
+static void GPS_D200_Send(UC* data, GPS_PWay way, int32_t* len);
+static void GPS_D201_Send(UC* data, GPS_PWay way, int32_t* len);
+static void GPS_D202_Send(UC* data, GPS_PWay way, int32_t* len);
+static void GPS_D210_Send(UC* data, GPS_PWay way, int32_t* len);
static void GPS_D400_Get(GPS_PWay* way, UC* s);
static void GPS_D403_Get(GPS_PWay* way, UC* s);
static void GPS_D450_Get(GPS_PWay* way, UC* s);
-static void GPS_D400_Send(UC* data, GPS_PWay way, int32* len);
-static void GPS_D403_Send(UC* data, GPS_PWay way, int32* len);
-static void GPS_D450_Send(UC* data, GPS_PWay way, int32* len);
+static void GPS_D400_Send(UC* data, GPS_PWay way, int32_t* len);
+static void GPS_D403_Send(UC* data, GPS_PWay way, int32_t* len);
+static void GPS_D450_Send(UC* data, GPS_PWay way, int32_t* len);
static void GPS_D500_Send(UC* data, GPS_PAlmanac alm);
static void GPS_D501_Send(UC* data, GPS_PAlmanac alm);
static UC Is_Trackpoint_Invalid(GPS_PTrack trk);
-int32 gps_save_id;
+int32_t gps_save_id;
int gps_is_usb;
double gps_save_version;
char gps_save_string[GPS_ARB_LEN];
**
** @return [int32] 1 if success -ve if error
************************************************************************/
-int32 GPS_Init(const char* port)
+int32_t GPS_Init(const char* port)
{
- int32 ret;
+ int32_t ret;
(void) GPS_Util_Little();
**
** @return [int32] 1 if success -ve if error
************************************************************************/
-static int32 GPS_A000(const char* port)
+static int32_t GPS_A000(const char* port)
{
gpsdevh* fd;
GPS_Packet tra;
GPS_Packet rec;
- int16 version;
- int16 id;
+ int16_t version;
+ int16_t id;
if (!GPS_Device_On(port, &fd)) {
return gps_errno;
{
US lasta=0;
- int32 entries = packet.n / 3;
+ int32_t entries = packet.n / 3;
const UC* p = packet.data;
- for (int32 i=0; i<entries; ++i,p+=3) {
+ for (int32_t i = 0; i<entries; ++i,p+=3) {
US tag = *p;
US data = GPS_Util_Get_Short(p+1);
**
** @return [int32] number of waypoint entries
************************************************************************/
-int32 GPS_A100_Get(const char* port, GPS_PWay** way, int (*cb)(int, GPS_PWay*))
+int32_t GPS_A100_Get(const char* port, GPS_PWay** way, int (*cb)(int, GPS_PWay*))
{
static UC data[2];
gpsdevh* fd;
GPS_Packet tra;
GPS_Packet rec;
- int32 n;
- int32 i;
+ int32_t n;
+ int32_t i;
if (!GPS_Device_On(port,&fd)) {
**
** @return [int32] success
************************************************************************/
-int32 GPS_A100_Send(const char* port, GPS_PWay* way, int32 n, int (*cb)(GPS_PWay*))
+int32_t GPS_A100_Send(const char* port, GPS_PWay* way, int32_t n, int (*cb)(GPS_PWay*))
{
UC data[GPS_ARB_LEN];
gpsdevh* fd;
GPS_Packet tra;
GPS_Packet rec;
- int32 i;
- int32 len;
+ int32_t i;
+ int32_t len;
if (!GPS_Device_On(port,&fd)) {
return gps_errno;
/*
* Get the list of waypoint categories from the receiver.
*/
-int32 GPS_A101_Get(const char* port)
+int32_t GPS_A101_Get(const char* port)
{
static UC data[2];
gpsdevh* fd;
GPS_Packet tra;
GPS_Packet rec;
- int32 n;
- int32 i;
+ int32_t n;
+ int32_t i;
if (!GPS_Device_On(port,&fd)) {
static void GPS_D100_Get(GPS_PWay* way, UC* s)
{
UC* p;
- int32 i;
+ int32_t i;
p=s;
}
(*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
for (i=0; i<40; ++i) {
(*way)->cmnt[i] = *p++;
static void GPS_D101_Get(GPS_PWay* way, UC* s)
{
UC* p;
- int32 i;
+ int32_t i;
p=s;
}
(*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
for (i=0; i<40; ++i) {
(*way)->cmnt[i] = *p++;
static void GPS_D102_Get(GPS_PWay* way, UC* s)
{
UC* p;
- int32 i;
+ int32_t i;
p=s;
}
(*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
for (i=0; i<40; ++i) {
(*way)->cmnt[i] = *p++;
static void GPS_D103_Get(GPS_PWay* way, UC* s)
{
UC* p;
- int32 i;
+ int32_t i;
p=s;
}
(*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
for (i=0; i<40; ++i) {
(*way)->cmnt[i] = *p++;
static void GPS_D104_Get(GPS_PWay* way, UC* s)
{
UC* p;
- int32 i;
+ int32_t i;
p=s;
}
(*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
for (i=0; i<40; ++i) {
(*way)->cmnt[i] = *p++;
p+=sizeof(float);
(*way)->smbl = GPS_Util_Get_Short(p);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
(*way)->dspl = *p;
(*way)->prot = 105;
(*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->smbl = GPS_Util_Get_Short(p);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
q = (UC*)(*way)->wpt_ident;
while ((*q++ = *p++));
{
UC* p;
UC* q;
- int32 i;
+ int32_t i;
p=s;
}
(*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->smbl = GPS_Util_Get_Short(p);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
q = (UC*)(*way)->wpt_ident;
while ((*q++ = *p++));
static void GPS_D107_Get(GPS_PWay* way, UC* s)
{
UC* p;
- int32 i;
+ int32_t i;
p=s;
}
(*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
for (i=0; i<40; ++i) {
(*way)->cmnt[i] = *p++;
UC* p;
UC* q;
- int32 i;
+ int32_t i;
p=s;
(*way)->dspl = *p++;
(*way)->attr = *p++;
(*way)->smbl = GPS_Util_Get_Short(p);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
for (i=0; i<18; ++i) {
(*way)->subclass[i] = *p++;
}
(*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->alt = GPS_Util_Get_Float(p);
p+=sizeof(float);
UC* p;
UC* q;
- int32 i;
+ int32_t i;
p=s;
(*way)->dspl = (*p++ >> 5) & 3;
(*way)->attr = *p++;
(*way)->smbl = GPS_Util_Get_Short(p);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
for (i=0; i<18; ++i) {
(*way)->subclass[i] = *p++;
}
(*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->alt = GPS_Util_Get_Float(p);
p+=sizeof(float);
(*way)->temperature = gps_temp;
}
- uint32 gps_time = GPS_Util_Get_Uint(p);
+ uint32_t gps_time = GPS_Util_Get_Uint(p);
p+=4;
/* The spec says that 0xffffffff is unknown, but the 60CSX with
* firmware 2.5.0 writes zero.
static void GPS_D150_Get(GPS_PWay* way, UC* s)
{
UC* p;
- int32 i;
+ int32_t i;
p=s;
(*way)->wpt_class = *p++;
(*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->alt = GPS_Util_Get_Short(p);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
for (i=0; i<24; ++i) {
(*way)->city[i] = *p++;
static void GPS_D151_Get(GPS_PWay* way, UC* s)
{
UC* p;
- int32 i;
+ int32_t i;
p=s;
}
(*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
for (i=0; i<40; ++i) {
(*way)->cmnt[i] = *p++;
}
(*way)->alt = GPS_Util_Get_Short(p);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
for (i=0; i<2; ++i) {
(*way)->cc[i] = *p++;
static void GPS_D152_Get(GPS_PWay* way, UC* s)
{
UC* p;
- int32 i;
+ int32_t i;
p=s;
}
(*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
for (i=0; i<40; ++i) {
(*way)->cmnt[i] = *p++;
}
(*way)->alt = GPS_Util_Get_Short(p);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
for (i=0; i<2; ++i) {
(*way)->cc[i] = *p++;
static void GPS_D154_Get(GPS_PWay* way, UC* s)
{
UC* p;
- int32 i;
+ int32_t i;
p=s;
}
(*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
for (i=0; i<40; ++i) {
(*way)->cmnt[i] = *p++;
}
(*way)->alt = GPS_Util_Get_Short(p);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
for (i=0; i<2; ++i) {
(*way)->cc[i] = *p++;
static void GPS_D155_Get(GPS_PWay* way, UC* s)
{
UC* p;
- int32 i;
+ int32_t i;
p=s;
}
(*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
for (i=0; i<40; ++i) {
(*way)->cmnt[i] = *p++;
}
(*way)->alt = GPS_Util_Get_Short(p);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
for (i=0; i<2; ++i) {
(*way)->cc[i] = *p++;
(*way)->wpt_class = *p++;
(*way)->smbl = GPS_Util_Get_Short(p);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
(*way)->dspl = *p;
**
** @return [void]
************************************************************************/
-static void GPS_D100_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D100_Send(UC* data, GPS_PWay way, int32_t* len)
{
UC* p;
copy_char_array(&p, way->ident, 6, UpperYes);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Uint(p,0);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
copy_char_array(&p, way->cmnt, 40, UpperYes);
*len = 58;
**
** @return [void]
************************************************************************/
-static void GPS_D101_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D101_Send(UC* data, GPS_PWay way, int32_t* len)
{
UC* p;
copy_char_array(&p, way->ident, 6, UpperYes);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Uint(p,0);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
copy_char_array(&p, way->cmnt, 40, UpperYes);
**
** @return [void]
************************************************************************/
-static void GPS_D102_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D102_Send(UC* data, GPS_PWay way, int32_t* len)
{
UC* p;
copy_char_array(&p, way->ident, 6, UpperYes);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Uint(p,0);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
copy_char_array(&p, way->cmnt, 40, UpperYes);
GPS_Util_Put_Float(p,way->dst);
**
** @return [void]
************************************************************************/
-static void GPS_D103_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D103_Send(UC* data, GPS_PWay way, int32_t* len)
{
UC* p;
copy_char_array(&p, way->ident, 6, UpperYes);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Uint(p,0);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
copy_char_array(&p, way->cmnt, 40, UpperYes);
*p++ = (UC) way->smbl;
**
** @return [void]
************************************************************************/
-static void GPS_D104_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D104_Send(UC* data, GPS_PWay way, int32_t* len)
{
UC* p;
copy_char_array(&p, way->ident, 6, UpperYes);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Uint(p,0);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
/* byonke confirms that sending lower case comment data to a III+
* results in the comment being truncated there. So we uppercase
* the entire comment.
GPS_Util_Put_Float(p,way->dst);
p+= sizeof(float);
- GPS_Util_Put_Short(p, (int16) way->smbl);
- p+=sizeof(int16);
+ GPS_Util_Put_Short(p, (int16_t) way->smbl);
+ p+=sizeof(int16_t);
*p = 3; /* display symbol with waypoint name */
**
** @return [void]
************************************************************************/
-static void GPS_D105_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D105_Send(UC* data, GPS_PWay way, int32_t* len)
{
UC* p;
UC* q;
p = data;
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
- GPS_Util_Put_Short(p, (int16) way->smbl);
- p+=sizeof(int16);
+ GPS_Util_Put_Short(p, (int16_t) way->smbl);
+ p+=sizeof(int16_t);
q = (UC*) way->wpt_ident;
while ((*p++ = *q++));
**
** @return [void]
************************************************************************/
-static void GPS_D106_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D106_Send(UC* data, GPS_PWay way, int32_t* len)
{
UC* p;
UC* q;
- int32 i;
+ int32_t i;
p = data;
*p++ = way->subclass[i];
}
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
- GPS_Util_Put_Short(p, (int16) way->smbl);
- p+=sizeof(int16);
+ GPS_Util_Put_Short(p, (int16_t) way->smbl);
+ p+=sizeof(int16_t);
q = (UC*) way->wpt_ident;
while ((*p++ = *q++));
**
** @return [void]
************************************************************************/
-static void GPS_D107_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D107_Send(UC* data, GPS_PWay way, int32_t* len)
{
UC* p;
copy_char_array(&p, way->ident, 6, UpperYes);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Uint(p,0);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
copy_char_array(&p, way->cmnt, 40, UpperYes);
*p++ = way->smbl;
**
** @return [void]
************************************************************************/
-static void GPS_D108_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D108_Send(UC* data, GPS_PWay way, int32_t* len)
{
UC* p;
UC* q;
- int32 i;
+ int32_t i;
p = data;
*p++ = way->dspl;
*p++ = 0x60;
GPS_Util_Put_Short(p,(US) way->smbl);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
for (i=0; i<18; ++i) {
*p++ = way->subclass[i];
}
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
if (way->alt_is_unknown) {
GPS_Util_Put_Float(p, 1.0e25f);
** @return [void]
** D109's and D110's are so similar, we handle them with the same code.
************************************************************************/
-static void GPS_D109_Send(UC* data, GPS_PWay way, int32* len, int protoid)
+static void GPS_D109_Send(UC* data, GPS_PWay way, int32_t* len, int protoid)
{
UC* p;
UC* q;
- int32 i;
+ int32_t i;
p = data;
GPS_Warning("Unknown protoid in GPS_D109_Send.");
}
GPS_Util_Put_Short(p,(US) way->smbl);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
for (i=0; i<18; ++i) {
*p++ = way->subclass[i];
}
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
if (way->alt_is_unknown) {
GPS_Util_Put_Float(p, 1.0e25f);
} else {
if (way->time_populated) {
GPS_Util_Put_Uint(p,GPS_Math_Utime_To_Gtime(way->time));
- p+=sizeof(uint32);
+ p+=sizeof(uint32_t);
} else {
for (i=0; i<4; ++i) {
*p++ = 0xff; /* unknown time*/
**
** @return [void]
************************************************************************/
-static void GPS_D150_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D150_Send(UC* data, GPS_PWay way, int32_t* len)
{
UC* p;
- int32 i;
+ int32_t i;
p = data;
*p++ = way->wpt_class;
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Short(p,(US) way->alt);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
copy_char_array(&p, way->city, 24, UpperYes);
copy_char_array(&p, way->state, 2, UpperYes);
**
** @return [void]
************************************************************************/
-static void GPS_D151_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D151_Send(UC* data, GPS_PWay way, int32_t* len)
{
UC* p;
- int32 i;
+ int32_t i;
p = data;
copy_char_array(&p, way->ident, 6, UpperYes);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Uint(p,0);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
copy_char_array(&p, way->cmnt, 40, UpperYes);
GPS_Util_Put_Float(p,way->dst);
p+=sizeof(float);
copy_char_array(&p, way->state, 2, UpperYes);
GPS_Util_Put_Short(p,(US) way->alt);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
for (i=0; i<2; ++i) {
*p++ = way->cc[i];
**
** @return [void]
************************************************************************/
-static void GPS_D152_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D152_Send(UC* data, GPS_PWay way, int32_t* len)
{
UC* p;
- int32 i;
+ int32_t i;
p = data;
copy_char_array(&p, way->ident, 6, UpperYes);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Uint(p,0);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
copy_char_array(&p, way->cmnt, 40, UpperYes);
GPS_Util_Put_Float(p,way->dst);
p+=sizeof(float);
copy_char_array(&p, way->state, 2, UpperYes);
GPS_Util_Put_Short(p,(US) way->alt);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
for (i=0; i<2; ++i) {
*p++ = way->cc[i];
**
** @return [void]
************************************************************************/
-static void GPS_D154_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D154_Send(UC* data, GPS_PWay way, int32_t* len)
{
UC* p;
- int32 i;
+ int32_t i;
p = data;
copy_char_array(&p, way->ident, 6, UpperYes);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Uint(p,0);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
copy_char_array(&p, way->cmnt, 40, UpperYes);
GPS_Util_Put_Float(p,way->dst);
copy_char_array(&p, way->state, 2, UpperYes);
GPS_Util_Put_Short(p,(US) way->alt);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
for (i=0; i<2; ++i) {
*p++ = way->cc[i];
}
*p++ = way->wpt_class;
- GPS_Util_Put_Short(p,(int16)way->smbl);
+ GPS_Util_Put_Short(p,(int16_t)way->smbl);
*len = 126;
**
** @return [void]
************************************************************************/
-static void GPS_D155_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D155_Send(UC* data, GPS_PWay way, int32_t* len)
{
UC* p;
copy_char_array(&p, way->ident, 6, UpperYes);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Uint(p,0);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
copy_char_array(&p, way->cmnt, 40, UpperYes);
GPS_Util_Put_Float(p,way->dst);
p+=sizeof(float);
copy_char_array(&p, way->state, 2, UpperYes);
GPS_Util_Put_Short(p,(US) way->alt);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
copy_char_array(&p, way->cc, 2, UpperYes);
*p++ = 0;
/* Ignore wpt_class; our D155 points are always user type which is "4". */
*p++ = 4;
- GPS_Util_Put_Short(p,(int16)way->smbl);
- p+=sizeof(int16);
+ GPS_Util_Put_Short(p,(int16_t)way->smbl);
+ p+=sizeof(int16_t);
*p = way->dspl;
**
** @return [int32] number of waypoint entries
************************************************************************/
-int32 GPS_A200_Get(const char* port, GPS_PWay** way)
+int32_t GPS_A200_Get(const char* port, GPS_PWay** way)
{
static UC data[2];
gpsdevh* fd;
GPS_Packet tra;
GPS_Packet rec;
- int32 n;
- int32 i;
+ int32_t n;
+ int32_t i;
if (!GPS_Device_On(port,&fd)) {
**
** @return [int32] number of waypoint entries
************************************************************************/
-int32 GPS_A201_Get(const char* port, GPS_PWay** way)
+int32_t GPS_A201_Get(const char* port, GPS_PWay** way)
{
static UC data[2];
gpsdevh* fd;
GPS_Packet tra;
GPS_Packet rec;
- int32 n;
- int32 i;
+ int32_t n;
+ int32_t i;
if (!GPS_Device_On(port,&fd)) {
**
** @return [int32] success
************************************************************************/
-int32 GPS_A200_Send(const char* port, GPS_PWay* way, int32 n)
+int32_t GPS_A200_Send(const char* port, GPS_PWay* way, int32_t n)
{
UC data[GPS_ARB_LEN];
gpsdevh* fd;
GPS_Packet tra;
GPS_Packet rec;
- int32 i;
- int32 len;
+ int32_t i;
+ int32_t len;
US method;
if (!GPS_Device_On(port,&fd)) {
**
** @return [int32] success
************************************************************************/
-int32 GPS_A201_Send(const char* port, GPS_PWay* way, int32 n)
+int32_t GPS_A201_Send(const char* port, GPS_PWay* way, int32_t n)
{
UC data[GPS_ARB_LEN];
gpsdevh* fd;
GPS_Packet tra;
GPS_Packet rec;
- int32 i;
- int32 len;
+ int32_t i;
+ int32_t len;
US method;
if (!GPS_Device_On(port,&fd)) {
static void GPS_D201_Get(GPS_PWay* way, UC* s)
{
UC* p;
- int32 i;
+ int32_t i;
p=s;
{
UC* p;
UC* q;
- int32 i;
+ int32_t i;
p=s;
(*way)->rte_link_class = GPS_Util_Get_Short(p);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
for (i=0; i<18; ++i) {
(*way)->rte_link_subclass[i] = *p++;
}
**
** @return [void]
************************************************************************/
-static void GPS_D200_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D200_Send(UC* data, GPS_PWay way, int32_t* len)
{
*data = way->rte_num;
**
** @return [void]
************************************************************************/
-static void GPS_D201_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D201_Send(UC* data, GPS_PWay way, int32_t* len)
{
UC* p;
**
** @return [void]
************************************************************************/
-static void GPS_D202_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D202_Send(UC* data, GPS_PWay way, int32_t* len)
{
UC* p;
UC* q;
**
** @return [void]
************************************************************************/
-static void GPS_D210_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D210_Send(UC* data, GPS_PWay way, int32_t* len)
{
UC* p;
UC* q;
- int32 i;
+ int32_t i;
p = data;
GPS_Util_Put_Short(p,(US) way->rte_link_class);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
for (i=0; i<18; ++i) {
*p++ = way->rte_link_subclass[i];
}
**
** @return [int32] number of track entries
************************************************************************/
-int32 GPS_A300_Get(const char* port , GPS_PTrack** trk, pcb_fn /*unused*/)
+int32_t GPS_A300_Get(const char* port, GPS_PTrack** trk, pcb_fn /*unused*/)
{
static UC data[2];
gpsdevh* fd;
GPS_Packet tra;
GPS_Packet rec;
- int32 n;
- int32 i;
- int32 ret;
+ int32_t n;
+ int32_t i;
+ int32_t ret;
if (gps_trk_transfer == -1) {
**
** @return [int32] number of track entries
************************************************************************/
-int32 GPS_A301_Get(const char* port, GPS_PTrack** trk, pcb_fn cb, int protoid)
+int32_t GPS_A301_Get(const char* port, GPS_PTrack** trk, pcb_fn cb, int protoid)
{
static UC data[2];
gpsdevh* fd;
GPS_Packet tra;
GPS_Packet rec;
- int32 n;
- int32 i;
+ int32_t n;
+ int32_t i;
US Pid_Trk_Data, Pid_Trk_Hdr, Cmnd_Transfer_Trk;
- int32 trk_type, trk_hdr_type;
+ int32_t trk_type, trk_hdr_type;
if (gps_trk_transfer == -1) {
return GPS_UNSUPPORTED;
**
** @return [int32] success
************************************************************************/
-int32 GPS_A300_Send(const char* port, GPS_PTrack* trk, int32 n)
+int32_t GPS_A300_Send(const char* port, GPS_PTrack* trk, int32_t n)
{
UC data[GPS_ARB_LEN];
gpsdevh* fd;
GPS_Packet tra;
GPS_Packet rec;
- int32 i;
- int32 len;
+ int32_t i;
+ int32_t len;
if (gps_trk_transfer == -1) {
return GPS_UNSUPPORTED;
**
** @return [int32] success
************************************************************************/
-int32 GPS_A301_Send(const char* port, GPS_PTrack* trk, int32 n, int protoid,
- gpsdevh* fd)
+int32_t GPS_A301_Send(const char* port, GPS_PTrack* trk, int32_t n, int protoid,
+ gpsdevh* fd)
{
UC data[GPS_ARB_LEN];
GPS_Packet tra;
GPS_Packet rec;
- int32 i;
- int32 len;
+ int32_t i;
+ int32_t len;
US method;
US Pid_Trk_Data, Pid_Trk_Hdr, Cmnd_Transfer_Trk;
- int32 trk_type, trk_hdr_type;
+ int32_t trk_type, trk_hdr_type;
if (gps_trk_transfer == -1) {
return GPS_UNSUPPORTED;
**
** @return [int32] number of entries read
************************************************************************/
-int32 GPS_D300_Get(GPS_PTrack* trk, int32 entries, gpsdevh* fd)
+int32_t GPS_D300_Get(GPS_PTrack* trk, int32_t entries, gpsdevh* fd)
{
GPS_Packet tra;
GPS_Packet rec;
- int32 i;
+ int32_t i;
for (i=0; i<entries; ++i) {
void GPS_D301b_Get(GPS_PTrack* trk, UC* data)
{
UC* p;
- uint32 t;
+ uint32_t t;
p=data;
(*trk)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*trk)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
t = GPS_Util_Get_Uint(p);
if (!t || t==0x7fffffff || t==0xffffffff) {
} else {
(*trk)->Time = GPS_Math_Gtime_To_Utime((time_t)t);
}
- p+=sizeof(uint32);
+ p+=sizeof(uint32_t);
(*trk)->alt = GPS_Util_Get_Float(p);
p+=sizeof(float);
void GPS_D302b_Get(GPS_PTrack* trk, UC* data)
{
UC* p;
- uint32 t;
+ uint32_t t;
double gps_temp;
p=data;
(*trk)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*trk)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
t = GPS_Util_Get_Uint(p);
if (!t || t==0x7fffffff || t==0xffffffff) {
} else {
(*trk)->Time = GPS_Math_Gtime_To_Utime((time_t)t);
}
- p+=sizeof(uint32);
+ p+=sizeof(uint32_t);
(*trk)->alt = GPS_Util_Get_Float(p);
p+=sizeof(float);
void GPS_D303b_Get(GPS_PTrack* trk, UC* data)
{
UC* p;
- uint32 t;
- uint32 raw_lat, raw_lon;
+ uint32_t t;
+ uint32_t raw_lat, raw_lon;
int lat_undefined, lon_undefined;
p=data;
} else {
(*trk)->lat = GPS_Math_Semi_To_Deg(raw_lat);
}
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
raw_lon = GPS_Util_Get_Int(p);
lon_undefined = !raw_lon || raw_lon==0x7fffffff || raw_lon==0xffffffff;
} else {
(*trk)->lon = GPS_Math_Semi_To_Deg(raw_lon);
}
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
/*
* Let the caller decide if it wants to toss trackpionts with only
} else {
(*trk)->Time = GPS_Math_Gtime_To_Utime((time_t)t);
}
- p+=sizeof(uint32);
+ p+=sizeof(uint32_t);
(*trk)->alt = GPS_Util_Get_Float(p);
p+=sizeof(float);
**
** @return [void]
************************************************************************/
-void GPS_D300_Send(UC* data, GPS_PTrack trk, int32* len)
+void GPS_D300_Send(UC* data, GPS_PTrack trk, int32_t* len)
{
UC* p;
**
** @return [void]
************************************************************************/
-void GPS_D301_Send(UC* data, GPS_PTrack trk, int32* len, int type)
+void GPS_D301_Send(UC* data, GPS_PTrack trk, int32_t* len, int type)
{
UC* p;
**
** @return [void]
************************************************************************/
-void GPS_D303_Send(UC* data, GPS_PTrack trk, int32* len, int protoid)
+void GPS_D303_Send(UC* data, GPS_PTrack trk, int32_t* len, int protoid)
{
UC* p;
**
** @return [void]
************************************************************************/
-void GPS_D311_Send(UC* data, GPS_PTrack trk, int32* len)
+void GPS_D311_Send(UC* data, GPS_PTrack trk, int32_t* len)
{
UC* p;
**
** @return [void]
************************************************************************/
-void GPS_D310_Send(UC* data, GPS_PTrack trk, int32* len)
+void GPS_D310_Send(UC* data, GPS_PTrack trk, int32_t* len)
{
UC* p;
UC* q;
static void GPS_A300_Translate(UC* s, GPS_PTrack* trk)
{
UC* p;
- uint32 t;
+ uint32_t t;
p=s;
(*trk)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*trk)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
t = GPS_Util_Get_Uint(p);
if (!t || t==0x7fffffff || t==0xffffffff) {
} else {
(*trk)->Time = GPS_Math_Gtime_To_Utime((time_t)t);
}
- p+=sizeof(uint32);
+ p+=sizeof(uint32_t);
(*trk)->tnew = *p;
}
* caller shouldn't set no_latlon unless one of these protocols actually
* is in use */
GPS_Util_Put_Int(p,trk->no_latlon ? 0x7fffffff : GPS_Math_Deg_To_Semi(trk->lat));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,trk->no_latlon ? 0x7fffffff : GPS_Math_Deg_To_Semi(trk->lon));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Uint(p,GPS_Math_Utime_To_Gtime(trk->Time));
- p+=sizeof(uint32);
+ p+=sizeof(uint32_t);
*p = (UC) trk->tnew;
}
**
** @return [int32] number of waypoint entries
************************************************************************/
-int32 GPS_A400_Get(const char* port, GPS_PWay** way)
+int32_t GPS_A400_Get(const char* port, GPS_PWay** way)
{
static UC data[2];
gpsdevh* fd;
GPS_Packet tra;
GPS_Packet rec;
- int32 n;
- int32 i;
+ int32_t n;
+ int32_t i;
if (gps_prx_waypt_transfer == -1) {
return GPS_UNSUPPORTED;
**
** @return [int32] success
************************************************************************/
-int32 GPS_A400_Send(const char* port, GPS_PWay* way, int32 n)
+int32_t GPS_A400_Send(const char* port, GPS_PWay* way, int32_t n)
{
UC data[GPS_ARB_LEN];
gpsdevh* fd;
GPS_Packet tra;
GPS_Packet rec;
- int32 i;
- int32 len;
+ int32_t i;
+ int32_t len;
if (gps_prx_waypt_transfer == -1) {
return GPS_UNSUPPORTED;
static void GPS_D400_Get(GPS_PWay* way, UC* s)
{
UC* p;
- int32 i;
+ int32_t i;
p=s;
}
(*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
for (i=0; i<40; ++i) {
(*way)->cmnt[i] = *p++;
static void GPS_D403_Get(GPS_PWay* way, UC* s)
{
UC* p;
- int32 i;
+ int32_t i;
p=s;
}
(*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
for (i=0; i<40; ++i) {
(*way)->cmnt[i] = *p++;
static void GPS_D450_Get(GPS_PWay* way, UC* s)
{
UC* p;
- int32 i;
+ int32_t i;
p=s;
(*way)->prot = 450;
(*way)->idx = GPS_Util_Get_Short(p);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
for (i=0; i<6; ++i) {
(*way)->ident[i] = *p++;
(*way)->wpt_class = *p++;
(*way)->lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*way)->alt = GPS_Util_Get_Short(p);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
for (i=0; i<24; ++i) {
(*way)->city[i] = *p++;
**
** @return [void]
************************************************************************/
-static void GPS_D400_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D400_Send(UC* data, GPS_PWay way, int32_t* len)
{
UC* p;
- int32 i;
+ int32_t i;
p = data;
*p++ = way->ident[i];
}
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Uint(p,0);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
for (i=0; i<40; ++i) {
*p++ = way->cmnt[i];
}
**
** @return [void]
************************************************************************/
-static void GPS_D403_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D403_Send(UC* data, GPS_PWay way, int32_t* len)
{
UC* p;
- int32 i;
+ int32_t i;
p = data;
*p++ = way->ident[i];
}
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Uint(p,0);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
for (i=0; i<40; ++i) {
*p++ = way->cmnt[i];
}
**
** @return [void]
************************************************************************/
-static void GPS_D450_Send(UC* data, GPS_PWay way, int32* len)
+static void GPS_D450_Send(UC* data, GPS_PWay way, int32_t* len)
{
UC* p;
- int32 i;
+ int32_t i;
p = data;
GPS_Util_Put_Short(p,(US) way->idx);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
for (i=0; i<6; ++i) {
*p++ = way->ident[i];
*p++ = way->wpt_class;
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lat));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(way->lon));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Short(p,(US) way->alt);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
for (i=0; i<24; ++i) {
*p++ = way->city[i];
**
** @return [int32] number of almanac entries
************************************************************************/
-int32 GPS_A500_Get(const char* port, GPS_PAlmanac** alm)
+int32_t GPS_A500_Get(const char* port, GPS_PAlmanac** alm)
{
static UC data[2];
gpsdevh* fd;
GPS_Packet trapkt;
GPS_Packet recpkt;
- int32 i, n;
+ int32_t i, n;
if (gps_almanac_transfer == -1) {
return GPS_UNSUPPORTED;
**
** @return [int32] success
************************************************************************/
-int32 GPS_A500_Send(const char* port, GPS_PAlmanac* alm, int32 n)
+int32_t GPS_A500_Send(const char* port, GPS_PAlmanac* alm, int32_t n)
{
UC data[GPS_ARB_LEN];
gpsdevh* fd;
GPS_Packet tra;
GPS_Packet rec;
- int32 i;
- int32 len;
- int32 timesent;
- int32 posnsent;
- int32 ret;
+ int32_t i;
+ int32_t len;
+ int32_t timesent;
+ int32_t posnsent;
+ int32_t ret;
if (!GPS_Device_On(port, &fd)) {
return gps_errno;
p=s;
(*alm)->wn = GPS_Util_Get_Short(p);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
(*alm)->toa = GPS_Util_Get_Float(p);
p+=sizeof(float);
p=s;
GPS_Util_Put_Short(p,alm->wn);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
GPS_Util_Put_Float(p,alm->toa);
p+=sizeof(float);
**
** @return [int32] success
************************************************************************/
-int32 GPS_A600_Send(const char* port, time_t Time)
+int32_t GPS_A600_Send(const char* port, time_t Time)
{
gpsdevh* fd;
GPS_Packet tra;
GPS_Packet rec;
- int32 posnsent=0;
- int32 ret=0;
+ int32_t posnsent = 0;
+ int32_t ret = 0;
if (!GPS_Device_On(port, &fd)) {
return gps_errno;
ts.tm_mon = *p++ - 1;
ts.tm_mday = *p++;
- ts.tm_year = (int32) GPS_Util_Get_Short(p) - 1900;
+ ts.tm_year = (int32_t) GPS_Util_Get_Short(p) - 1900;
p+=2;
- ts.tm_hour = (int32) GPS_Util_Get_Short(p);
+ ts.tm_hour = (int32_t) GPS_Util_Get_Short(p);
p+=2;
ts.tm_min = *p++;
ts.tm_sec = *p++;
**
** @return [int32] success
************************************************************************/
-int32 GPS_A700_Get(const char* port, double* lat, double* lon)
+int32_t GPS_A700_Get(const char* port, double* lat, double* lon)
{
static UC data[2];
gpsdevh* fd;
**
** @return [int32] success
************************************************************************/
-int32 GPS_A700_Send(const char* port, double lat, double lon)
+int32_t GPS_A700_Send(const char* port, double lat, double lon)
{
gpsdevh* fd;
GPS_Packet tra;
**
** @return [int32] success
************************************************************************/
-int32 GPS_A800_On(const char* port, gpsdevh** fd)
+int32_t GPS_A800_On(const char* port, gpsdevh** fd)
{
static UC data[2];
GPS_Packet tra;
**
** @return [int32] success
************************************************************************/
-int32 GPS_A800_Off(const char* /*unused*/, gpsdevh** fd)
+int32_t GPS_A800_Off(const char* /*unused*/, gpsdevh** fd)
{
static UC data[2];
GPS_Packet tra;
**
** @return [int32] success
************************************************************************/
-int32 GPS_A800_Get(gpsdevh** fd, GPS_PPvt_Data* packet)
+int32_t GPS_A800_Get(gpsdevh** fd, GPS_PPvt_Data* packet)
{
GPS_Packet tra;
GPS_Packet rec;
p+=sizeof(float);
(*pvt)->fix = GPS_Util_Get_Short(p);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
(*pvt)->tow = GPS_Util_Get_Double(p);
p+=sizeof(double);
p+=sizeof(float);
(*pvt)->leap_scnds = GPS_Util_Get_Short(p);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
(*pvt)->wn_days = GPS_Util_Get_Int(p);
}
** @return [int32] number of lap entries
************************************************************************/
-int32 GPS_A906_Get(const char* port, GPS_PLap** lap, pcb_fn cb)
+int32_t GPS_A906_Get(const char* port, GPS_PLap** lap, pcb_fn cb)
{
static UC data[2];
gpsdevh* fd;
GPS_Packet trapkt;
GPS_Packet recpkt;
- int32 i, n;
+ int32_t i, n;
if (gps_lap_transfer == -1) {
return GPS_UNSUPPORTED;
************************************************************************/
void GPS_D1011b_Get(GPS_PLap* Lap, UC* p)
{
- uint32 t;
+ uint32_t t;
/* Lap index (not in D906) */
switch (gps_lap_type) {
break;
case pD1001:
(*Lap)->index = GPS_Util_Get_Uint(p);
- p+=sizeof(uint32);
+ p+=sizeof(uint32_t);
break;
case pD1011:
case pD1015:
(*Lap)->index = GPS_Util_Get_Short(p);
- p+=sizeof(uint16);
- p+=sizeof(uint16); /*unused*/
+ p+=sizeof(uint16_t);
+ p+=sizeof(uint16_t); /*unused*/
break;
default:
break;
t = GPS_Util_Get_Uint(p);
(*Lap)->start_time = GPS_Math_Gtime_To_Utime((time_t)t);
- p+=sizeof(uint32);
+ p+=sizeof(uint32_t);
(*Lap)->total_time = GPS_Util_Get_Int(p);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*Lap)->total_distance = GPS_Util_Get_Float(p);
p+=sizeof(float);
}
(*Lap)->begin_lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*Lap)->begin_lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*Lap)->end_lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*Lap)->end_lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*Lap)->calories = GPS_Util_Get_Short(p);
- p+=sizeof(int16);
+ p+=sizeof(int16_t);
/* Track index, only in D906*/
if (gps_lap_type == pD906) {
** @return [int32] number of course entries
************************************************************************/
-int32 GPS_A1006_Get
+int32_t GPS_A1006_Get
(const char* port,
GPS_PCourse** crs,
pcb_fn cb)
gpsdevh* fd;
GPS_Packet trapkt;
GPS_Packet recpkt;
- int32 i, n;
+ int32_t i, n;
if (gps_course_transfer == -1) {
return GPS_UNSUPPORTED;
**
** @return [int32] success
************************************************************************/
-int32 GPS_A1006_Send(const char* /*unused*/,
- GPS_PCourse* crs,
- int32 n_crs,
- gpsdevh* fd)
+int32_t GPS_A1006_Send(const char* /*unused*/,
+ GPS_PCourse* crs,
+ int32_t n_crs,
+ gpsdevh* fd)
{
UC data[GPS_ARB_LEN];
GPS_Packet tra;
GPS_Packet rec;
- int32 i;
- int32 len;
+ int32_t i;
+ int32_t len;
GPS_Util_Put_Short(data,(US) n_crs);
GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records,
{
int i;
(*crs)->index = GPS_Util_Get_Short(p);
- p+=sizeof(uint16);
- p+=sizeof(uint16); // unused
+ p+=sizeof(uint16_t);
+ p+=sizeof(uint16_t); // unused
for (i=0; i<16; ++i) {
(*crs)->course_name[i] = *p++;
}
(*crs)->track_index = GPS_Util_Get_Short(p);
- p+=sizeof(uint16);
+ p+=sizeof(uint16_t);
}
**
** @return [void]
************************************************************************/
-void GPS_D1006_Send(UC* data, GPS_PCourse crs, int32* len)
+void GPS_D1006_Send(UC* data, GPS_PCourse crs, int32_t* len)
{
UC* p;
int j;
p += 2;
GPS_Util_Put_Uint(p,0);
- p+=sizeof(uint16);
+ p+=sizeof(uint16_t);
for (j=0; j<16; ++j) {
*p++ = crs->course_name[j];
** @return [int32] number of lap entries
************************************************************************/
-int32 GPS_A1007_Get(const char* port, GPS_PCourse_Lap** clp, pcb_fn cb)
+int32_t GPS_A1007_Get(const char* port, GPS_PCourse_Lap** clp, pcb_fn cb)
{
static UC data[2];
gpsdevh* fd;
GPS_Packet trapkt;
GPS_Packet recpkt;
- int32 i, n;
+ int32_t i, n;
if (gps_course_lap_transfer == -1) {
return GPS_UNSUPPORTED;
**
** @return [int32] success
************************************************************************/
-int32 GPS_A1007_Send(const char* /*unused*/,
- GPS_PCourse_Lap* clp,
- int32 n_clp,
- gpsdevh* fd)
+int32_t GPS_A1007_Send(const char* /*unused*/,
+ GPS_PCourse_Lap* clp,
+ int32_t n_clp,
+ gpsdevh* fd)
{
UC data[GPS_ARB_LEN];
GPS_Packet tra;
GPS_Packet rec;
- int32 i;
- int32 len;
+ int32_t i;
+ int32_t len;
GPS_Util_Put_Short(data,(US) n_clp);
GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records,
void GPS_D1007_Get(GPS_PCourse_Lap* clp, UC* p)
{
(*clp)->course_index = GPS_Util_Get_Short(p);
- p+=sizeof(uint16);
+ p+=sizeof(uint16_t);
(*clp)->lap_index = GPS_Util_Get_Short(p);
- p+=sizeof(uint16);
+ p+=sizeof(uint16_t);
(*clp)->total_time = GPS_Util_Get_Int(p);
- p+=sizeof(uint32);
+ p+=sizeof(uint32_t);
(*clp)->total_dist = GPS_Util_Get_Float(p);
p+=sizeof(float);
(*clp)->begin_lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*clp)->begin_lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*clp)->end_lat = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*clp)->end_lon = GPS_Math_Semi_To_Deg(GPS_Util_Get_Int(p));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
(*clp)->avg_heart_rate = *p++;
(*clp)->max_heart_rate = *p++;
**
** @return [void]
************************************************************************/
-void GPS_D1007_Send(UC* data, GPS_PCourse_Lap clp, int32* len)
+void GPS_D1007_Send(UC* data, GPS_PCourse_Lap clp, int32_t* len)
{
UC* p;
p = data;
p += 2;
GPS_Util_Put_Uint(p, clp->total_time);
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Float(p,clp->total_dist);
p+= sizeof(float);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(clp->begin_lat));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(clp->begin_lon));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(clp->end_lat));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
GPS_Util_Put_Int(p,GPS_Math_Deg_To_Semi(clp->end_lon));
- p+=sizeof(int32);
+ p+=sizeof(int32_t);
*p++ = clp->avg_heart_rate;
** @return [int32] number of course point entries
************************************************************************/
-int32 GPS_A1008_Get(const char* port, GPS_PCourse_Point** cpt, pcb_fn cb)
+int32_t GPS_A1008_Get(const char* port, GPS_PCourse_Point** cpt, pcb_fn cb)
{
static UC data[2];
gpsdevh* fd;
GPS_Packet trapkt;
GPS_Packet recpkt;
- int32 i, n;
+ int32_t i, n;
if (gps_course_point_transfer == -1) {
return GPS_UNSUPPORTED;
**
** @return [int32] success
************************************************************************/
-int32 GPS_A1008_Send(const char* /*unused*/,
- GPS_PCourse_Point* cpt,
- int32 n_cpt,
- gpsdevh* fd)
+int32_t GPS_A1008_Send(const char* /*unused*/,
+ GPS_PCourse_Point* cpt,
+ int32_t n_cpt,
+ gpsdevh* fd)
{
UC data[GPS_ARB_LEN];
GPS_Packet tra;
GPS_Packet rec;
- int32 i;
- int32 len;
+ int32_t i;
+ int32_t len;
GPS_Util_Put_Short(data,(US) n_cpt);
GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records,
void GPS_D1012_Get(GPS_PCourse_Point* cpt, UC* p)
{
int i;
- uint32 t;
+ uint32_t t;
for (i=0; i<11; ++i) {
(*cpt)->name[i] = *p++;
}
p++; //unused
(*cpt)->course_index = GPS_Util_Get_Short(p);
- p+=sizeof(uint16);
- p+=sizeof(uint16); // unused
+ p+=sizeof(uint16_t);
+ p+=sizeof(uint16_t); // unused
t = GPS_Util_Get_Uint(p);
(*cpt)->track_point_time = GPS_Math_Gtime_To_Utime((time_t)t);
- p+=sizeof(uint32);
+ p+=sizeof(uint32_t);
(*cpt)->point_type = *p++;
**
** @return [void]
************************************************************************/
-void GPS_D1012_Send(UC* data, GPS_PCourse_Point cpt, int32* len)
+void GPS_D1012_Send(UC* data, GPS_PCourse_Point cpt, int32_t* len)
{
UC* p;
int j;
p += 2;
GPS_Util_Put_Uint(p,0);
- p+=sizeof(uint16);
+ p+=sizeof(uint16_t);
GPS_Util_Put_Uint(p,GPS_Math_Utime_To_Gtime(cpt->track_point_time));
- p+=sizeof(uint32);
+ p+=sizeof(uint32_t);
*p++ = cpt->point_type;
** @return [int32] success
************************************************************************/
-int32 GPS_A1009_Get(const char* port, GPS_PCourse_Limits limits)
+int32_t GPS_A1009_Get(const char* port, GPS_PCourse_Limits limits)
{
static UC data[2];
gpsdevh* fd;
void GPS_D1013_Get(GPS_PCourse_Limits limits, UC* p)
{
limits->max_courses = GPS_Util_Get_Uint(p);
- p+=sizeof(uint32);
+ p+=sizeof(uint32_t);
limits->max_course_laps = GPS_Util_Get_Uint(p);
- p+=sizeof(uint32);
+ p+=sizeof(uint32_t);
limits->max_course_pnt = GPS_Util_Get_Uint(p);
- p+=sizeof(uint32);
+ p+=sizeof(uint32_t);
limits->max_course_trk_pnt = GPS_Util_Get_Uint(p);
- p+=sizeof(uint32);
+ p+=sizeof(uint32_t);
}
** @param [r] trk [GPS_PTrack **] track
** @param [r] n [int32 *] Number of trackpoints
************************************************************************/
-void GPS_Prepare_Track_For_Device(GPS_PTrack** trk, int32* n)
+void GPS_Prepare_Track_For_Device(GPS_PTrack** trk, int32_t* n)
{
/* D303/304 marks track segments with two consecutive invalid track
* points instead of the tnew flag. Create them unless we're at the
* done here because it will change the number of track points.
*/
if (gps_trk_type == pD303 || gps_trk_type == pD304) {
- for (int32 i=0; i<*n; ++i) {
+ for (int32_t i = 0; i<*n; ++i) {
if ((*trk)[i]->tnew && i>0 && !(*trk)[i]->ishdr && !(*trk)[i-1]->ishdr) {
/* Create invalid points based on the data from the point
* marked with tnew and the one before it.
*/
- for (int32 j=i-1; j<=i; ++j) {
+ for (int32_t j = i - 1; j<=i; ++j) {
if (!Is_Trackpoint_Invalid((*trk)[j])) {
GPS_PTrack trkpt = GPS_Track_New();
*trkpt = *((*trk)[j]);
}
}
-int32 GPS_Set_Baud_Rate(const char* port, int br)
+int32_t GPS_Set_Baud_Rate(const char* port, int br)
{
gpsdevh* fd;
#include "jeeps/gps.h"
- int32 GPS_Init(const char* port);
+int32_t GPS_Init(const char* port);
- int32 GPS_A100_Get(const char* port, GPS_PWay** way, int (*cb)(int ct, GPS_PWay*));
- int32 GPS_A101_Get(const char* port);
- int32 GPS_A100_Send(const char* port, GPS_PWay* way, int32 n, int (*cb)(GPS_PWay*));
+int32_t GPS_A100_Get(const char* port, GPS_PWay** way, int (*cb)(int ct, GPS_PWay*));
+int32_t GPS_A101_Get(const char* port);
+int32_t GPS_A100_Send(const char* port, GPS_PWay* way, int32_t n, int (*cb)(GPS_PWay*));
- int32 GPS_A200_Get(const char* port, GPS_PWay** way);
- int32 GPS_A201_Get(const char* port, GPS_PWay** way);
- int32 GPS_A200_Send(const char* port, GPS_PWay* way, int32 n);
- int32 GPS_A201_Send(const char* port, GPS_PWay* way, int32 n);
+int32_t GPS_A200_Get(const char* port, GPS_PWay** way);
+int32_t GPS_A201_Get(const char* port, GPS_PWay** way);
+int32_t GPS_A200_Send(const char* port, GPS_PWay* way, int32_t n);
+int32_t GPS_A201_Send(const char* port, GPS_PWay* way, int32_t n);
- int32 GPS_A300_Get(const char* port, GPS_PTrack** trk, pcb_fn cb);
- int32 GPS_A301_Get(const char* port, GPS_PTrack** trk, pcb_fn cb, int protoid);
- int32 GPS_A300_Send(const char* port, GPS_PTrack* trk, int32 n);
- int32 GPS_A301_Send(const char* port, GPS_PTrack* trk, int32 n, int protoid,
- gpsdevh* fd);
+int32_t GPS_A300_Get(const char* port, GPS_PTrack** trk, pcb_fn cb);
+int32_t GPS_A301_Get(const char* port, GPS_PTrack** trk, pcb_fn cb, int protoid);
+int32_t GPS_A300_Send(const char* port, GPS_PTrack* trk, int32_t n);
+int32_t GPS_A301_Send(const char* port, GPS_PTrack* trk, int32_t n, int protoid,
+ gpsdevh* fd);
- int32 GPS_D300_Get(GPS_PTrack* trk, int32 entries, gpsdevh* h);
+int32_t GPS_D300_Get(GPS_PTrack* trk, int32_t entries, gpsdevh* h);
void GPS_D300b_Get(GPS_PTrack* trk, UC* data);
void GPS_D301b_Get(GPS_PTrack* trk, UC* data);
void GPS_D302b_Get(GPS_PTrack* trk, UC* data);
void GPS_D303b_Get(GPS_PTrack* trk, UC* data); /*D304*/
void GPS_D310_Get(GPS_PTrack* trk, UC* s);
void GPS_D311_Get(GPS_PTrack* trk, UC* s);
- void GPS_D300_Send(UC* data, GPS_PTrack trk, int32* len);
- void GPS_D301_Send(UC* data, GPS_PTrack trk, int32* len, int type);
- void GPS_D303_Send(UC* data, GPS_PTrack trk, int32* len, int protoid);
- void GPS_D310_Send(UC* data, GPS_PTrack trk, int32* len);
- void GPS_D311_Send(UC* data, GPS_PTrack trk, int32* len);
+ void GPS_D300_Send(UC* data, GPS_PTrack trk, int32_t* len);
+ void GPS_D301_Send(UC* data, GPS_PTrack trk, int32_t* len, int type);
+ void GPS_D303_Send(UC* data, GPS_PTrack trk, int32_t* len, int protoid);
+ void GPS_D310_Send(UC* data, GPS_PTrack trk, int32_t* len);
+ void GPS_D311_Send(UC* data, GPS_PTrack trk, int32_t* len);
- int32 GPS_A400_Get(const char* port, GPS_PWay** way);
- int32 GPS_A400_Send(const char* port, GPS_PWay* way, int32 n);
+int32_t GPS_A400_Get(const char* port, GPS_PWay** way);
+int32_t GPS_A400_Send(const char* port, GPS_PWay* way, int32_t n);
- int32 GPS_A500_Get(const char* port, GPS_PAlmanac** alm);
- int32 GPS_A500_Send(const char* port, GPS_PAlmanac* alm, int32 n);
+int32_t GPS_A500_Get(const char* port, GPS_PAlmanac** alm);
+int32_t GPS_A500_Send(const char* port, GPS_PAlmanac* alm, int32_t n);
time_t GPS_A600_Get(const char* port);
time_t GPS_D600_Get(const GPS_Packet& packet);
- int32 GPS_A600_Send(const char* port, time_t Time);
+int32_t GPS_A600_Send(const char* port, time_t Time);
void GPS_D600_Send(GPS_Packet& packet, time_t Time);
- int32 GPS_A700_Get(const char* port, double* lat, double* lon);
- int32 GPS_A700_Send(const char* port, double lat, double lon);
+int32_t GPS_A700_Get(const char* port, double* lat, double* lon);
+int32_t GPS_A700_Send(const char* port, double lat, double lon);
void GPS_D700_Get(const GPS_Packet& packet, double* lat, double* lon);
void GPS_D700_Send(GPS_Packet& packet, double lat, double lon);
- int32 GPS_A800_On(const char* port, gpsdevh** fd);
- int32 GPS_A800_Off(const char* port, gpsdevh** fd);
- int32 GPS_A800_Get(gpsdevh** fd, GPS_PPvt_Data* packet);
+int32_t GPS_A800_On(const char* port, gpsdevh** fd);
+int32_t GPS_A800_Off(const char* port, gpsdevh** fd);
+int32_t GPS_A800_Get(gpsdevh** fd, GPS_PPvt_Data* packet);
void GPS_D800_Get(const GPS_Packet& packet, GPS_PPvt_Data* pvt);
- int32 GPS_A906_Get(const char* port, GPS_PLap** lap, pcb_fn cb);
+int32_t GPS_A906_Get(const char* port, GPS_PLap** lap, pcb_fn cb);
void GPS_D1011b_Get(GPS_PLap* Lap,UC* data); /*D906 D1001 D1015*/
- int32 GPS_A1006_Get(const char* port, GPS_PCourse** crs, pcb_fn cb);
- int32 GPS_A1006_Send(const char* port, GPS_PCourse* crs, int32 n_crs,
- gpsdevh* fd);
+int32_t GPS_A1006_Get(const char* port, GPS_PCourse** crs, pcb_fn cb);
+int32_t GPS_A1006_Send(const char* port, GPS_PCourse* crs, int32_t n_crs,
+ gpsdevh* fd);
void GPS_D1006_Get(GPS_PCourse* crs, UC* p);
- void GPS_D1006_Send(UC* data, GPS_PCourse crs, int32* len);
+ void GPS_D1006_Send(UC* data, GPS_PCourse crs, int32_t* len);
- int32 GPS_A1007_Get(const char* port, GPS_PCourse_Lap** clp, pcb_fn cb);
- int32 GPS_A1007_Send(const char* port, GPS_PCourse_Lap* clp, int32 n_clp,
- gpsdevh* fd);
+int32_t GPS_A1007_Get(const char* port, GPS_PCourse_Lap** clp, pcb_fn cb);
+int32_t GPS_A1007_Send(const char* port, GPS_PCourse_Lap* clp, int32_t n_clp,
+ gpsdevh* fd);
void GPS_D1007_Get(GPS_PCourse_Lap* clp, UC* p);
- void GPS_D1007_Send(UC* data, GPS_PCourse_Lap clp, int32* len);
+ void GPS_D1007_Send(UC* data, GPS_PCourse_Lap clp, int32_t* len);
- int32 GPS_A1008_Get(const char* port, GPS_PCourse_Point** cpt, pcb_fn cb);
- int32 GPS_A1008_Send(const char* port, GPS_PCourse_Point* cpt, int32 n_cpt,
- gpsdevh* fd);
+int32_t GPS_A1008_Get(const char* port, GPS_PCourse_Point** cpt, pcb_fn cb);
+int32_t GPS_A1008_Send(const char* port, GPS_PCourse_Point* cpt, int32_t n_cpt,
+ gpsdevh* fd);
void GPS_D1012_Get(GPS_PCourse_Point* cpt, UC* p);
- void GPS_D1012_Send(UC* data, GPS_PCourse_Point cpt, int32* len);
+ void GPS_D1012_Send(UC* data, GPS_PCourse_Point cpt, int32_t* len);
- int32 GPS_A1009_Get(const char* port, GPS_PCourse_Limits limits);
+int32_t GPS_A1009_Get(const char* port, GPS_PCourse_Limits limits);
void GPS_D1013_Get(GPS_PCourse_Limits limits, UC* p);
/* Unhandled documented protocols, as of:
const char* Get_Pkt_Type(US p, US d0, const char** xinfo);
- void GPS_Prepare_Track_For_Device(GPS_PTrack** trk, int32* n);
- int32 GPS_Set_Baud_Rate(const char* port, int br);
+ void GPS_Prepare_Track_For_Device(GPS_PTrack** trk, int32_t* n);
+int32_t GPS_Set_Baud_Rate(const char* port, int br);
#endif // JEEPS_GPSAPP_H_INCLUDED_
** @return [int32] success
************************************************************************/
-int32 GPS_Command_Off(const char* port)
+int32_t GPS_Command_Off(const char* port)
{
static UC data[2];
gpsdevh* fd;
** @return [int32] number of waypoint entries
************************************************************************/
-int32 GPS_Command_Get_Waypoint(const char* port, GPS_PWay** way, pcb_fn cb)
+int32_t GPS_Command_Get_Waypoint(const char* port, GPS_PWay** way, pcb_fn cb)
{
- int32 ret=0;
+ int32_t ret = 0;
/*
* It's a bit tacky to do this up front without ticking the
** @return [int32] success
************************************************************************/
-int32 GPS_Command_Send_Waypoint(const char* port, GPS_PWay* way, int32 n, int (*cb)(GPS_SWay**))
+int32_t GPS_Command_Send_Waypoint(const char* port, GPS_PWay* way, int32_t n, int (*cb)(GPS_SWay**))
{
- int32 ret=0;
+ int32_t ret = 0;
switch (gps_waypt_transfer) {
case pA100:
** @return [int32] number of waypoint entries
************************************************************************/
-int32 GPS_Command_Get_Route(const char* port, GPS_PWay** way)
+int32_t GPS_Command_Get_Route(const char* port, GPS_PWay** way)
{
- int32 ret=0;
+ int32_t ret = 0;
switch (gps_route_transfer) {
case pA200:
** @return [int32] success
************************************************************************/
-int32 GPS_Command_Send_Route(const char* port, GPS_PWay* way, int32 n)
+int32_t GPS_Command_Send_Route(const char* port, GPS_PWay* way, int32_t n)
{
- int32 ret=0;
+ int32_t ret = 0;
switch (gps_route_transfer) {
** @return [int32] number of track entries
************************************************************************/
-int32 GPS_Command_Get_Track(const char* port, GPS_PTrack** trk, pcb_fn cb)
+int32_t GPS_Command_Get_Track(const char* port, GPS_PTrack** trk, pcb_fn cb)
{
- int32 ret=0;
+ int32_t ret = 0;
if (gps_trk_transfer == -1) {
return GPS_UNSUPPORTED;
** @return [int32] success
************************************************************************/
-int32 GPS_Command_Send_Track(const char* port, GPS_PTrack* trk, int32 n, int eraset)
+int32_t GPS_Command_Send_Track(const char* port, GPS_PTrack* trk, int32_t n, int eraset)
{
- int32 ret=0;
+ int32_t ret = 0;
if (gps_trk_transfer == -1) {
return GPS_UNSUPPORTED;
** @return [int32] number of waypoint entries
************************************************************************/
-int32 GPS_Command_Get_Proximity(const char* port, GPS_PWay** way)
+int32_t GPS_Command_Get_Proximity(const char* port, GPS_PWay** way)
{
- int32 ret=0;
+ int32_t ret = 0;
if (gps_prx_waypt_transfer == -1) {
return GPS_UNSUPPORTED;
** @return [int32] success
************************************************************************/
-int32 GPS_Command_Send_Proximity(const char* port, GPS_PWay* way, int32 n)
+int32_t GPS_Command_Send_Proximity(const char* port, GPS_PWay* way, int32_t n)
{
- int32 ret=0;
+ int32_t ret = 0;
if (gps_prx_waypt_transfer == -1) {
** @return [int32] number of almanac entries
************************************************************************/
-int32 GPS_Command_Get_Almanac(const char* port, GPS_PAlmanac** alm)
+int32_t GPS_Command_Get_Almanac(const char* port, GPS_PAlmanac** alm)
{
- int32 ret=0;
+ int32_t ret = 0;
if (gps_almanac_transfer == -1) {
return GPS_UNSUPPORTED;
** @return [int32] success
************************************************************************/
-int32 GPS_Command_Send_Almanac(const char* port, GPS_PAlmanac* alm, int32 n)
+int32_t GPS_Command_Send_Almanac(const char* port, GPS_PAlmanac* alm, int32_t n)
{
- int32 ret=0;
+ int32_t ret = 0;
if (gps_almanac_transfer == -1) {
return GPS_UNSUPPORTED;
** @return [int32] true if OK
************************************************************************/
-int32 GPS_Command_Send_Time(const char* port, time_t Time)
+int32_t GPS_Command_Send_Time(const char* port, time_t Time)
{
time_t ret=0;
** @return [int32] success
************************************************************************/
-int32 GPS_Command_Get_Position(const char* port, double* lat, double* lon)
+int32_t GPS_Command_Get_Position(const char* port, double* lat, double* lon)
{
- int32 ret=0;
+ int32_t ret = 0;
switch (gps_position_transfer) {
case pA700:
** @return [int32] success
************************************************************************/
-int32 GPS_Command_Send_Position(const char* port, double lat, double lon)
+int32_t GPS_Command_Send_Position(const char* port, double lat, double lon)
{
- int32 ret=0;
+ int32_t ret = 0;
switch (gps_position_transfer) {
case pA700:
** @return [int32] success if supported and GPS starts sending
************************************************************************/
-int32 GPS_Command_Pvt_On(const char* port, gpsdevh** fd)
+int32_t GPS_Command_Pvt_On(const char* port, gpsdevh** fd)
{
- int32 ret=0;
+ int32_t ret = 0;
if (gps_pvt_transfer == -1) {
** @return [int32] success
************************************************************************/
-int32 GPS_Command_Pvt_Off(const char* port, gpsdevh** fd)
+int32_t GPS_Command_Pvt_Off(const char* port, gpsdevh** fd)
{
- int32 ret=0;
+ int32_t ret = 0;
if (gps_pvt_transfer == -1) {
** @return [int32] success
************************************************************************/
-int32 GPS_Command_Pvt_Get(gpsdevh** fd, GPS_PPvt_Data* pvt)
+int32_t GPS_Command_Pvt_Get(gpsdevh** fd, GPS_PPvt_Data* pvt)
{
- int32 ret=0;
+ int32_t ret = 0;
if (gps_pvt_transfer == -1) {
return GPS_UNSUPPORTED;
** @return [int32] number of lap entries
************************************************************************/
-int32 GPS_Command_Get_Lap(const char* port, GPS_PLap** lap, pcb_fn cb)
+int32_t GPS_Command_Get_Lap(const char* port, GPS_PLap** lap, pcb_fn cb)
{
- int32 ret=0;
+ int32_t ret = 0;
if (gps_lap_transfer == -1) {
return GPS_UNSUPPORTED;
**
** @return [int32] number of course entries
************************************************************************/
-int32 GPS_Command_Get_Course
+int32_t GPS_Command_Get_Course
(const char* port,
GPS_PCourse** crs,
GPS_PCourse_Lap** clp,
GPS_PTrack** trk,
GPS_PCourse_Point** cpt,
- int32* n_clp,
- int32* n_trk,
- int32* n_cpt,
+ int32_t* n_clp,
+ int32_t* n_trk,
+ int32_t* n_cpt,
pcb_fn cb)
{
- int32 ret=0;
+ int32_t ret = 0;
if (gps_course_transfer == -1) {
return GPS_UNSUPPORTED;
**
** @return [int32] Success
************************************************************************/
-int32 GPS_Command_Send_Course
+int32_t GPS_Command_Send_Course
(const char* port,
GPS_PCourse* crs,
GPS_PCourse_Lap* clp,
GPS_PTrack* trk,
GPS_PCourse_Point* cpt,
- int32 n_crs,
- int32 n_clp,
- int32 n_trk,
- int32 n_cpt)
+ int32_t n_crs,
+ int32_t n_clp,
+ int32_t n_trk,
+ int32_t n_cpt)
{
gpsdevh* fd;
GPS_OCourse_Limits limits;
- int32 ret;
- int32 ret_crs=0;
- int32 ret_clp=0;
- int32 ret_trk=0;
- int32 ret_cpt=0;
+ int32_t ret;
+ int32_t ret_crs = 0;
+ int32_t ret_clp = 0;
+ int32_t ret_trk = 0;
+ int32_t ret_cpt = 0;
if (gps_course_transfer == -1 || gps_course_limits_transfer == -1) {
return GPS_UNSUPPORTED;
**
** @return [uint32] course index
************************************************************************/
-static uint32 Unique_Course_Index(GPS_PCourse* crs, int n_crs)
+static uint32_t Unique_Course_Index(GPS_PCourse* crs, int n_crs)
{
- uint32 idx;
+ uint32_t idx;
int i;
for (idx=0; ; idx++) {
**
** @return [uint32] track index
************************************************************************/
-static uint32 Unique_Track_Index(GPS_PCourse* crs, int n_crs)
+static uint32_t Unique_Track_Index(GPS_PCourse* crs, int n_crs)
{
- uint32 idx;
+ uint32_t idx;
int i;
for (idx=0; ; idx++) {
/* Remove unreferenced tracks */
restart_tracks:
for (i=0; i<*n_ctk; i++) {
- uint32 trk_idx;
+ uint32_t trk_idx;
if (!ctk[i]->ishdr) {
continue;
** @return [int32] success
************************************************************************/
-int32 GPS_Command_Send_Track_As_Course(const char* port, GPS_PTrack* trk, int32 n_trk,
- GPS_PWay* wpt, int32 n_wpt, int eraset)
+int32_t GPS_Command_Send_Track_As_Course(const char* port, GPS_PTrack* trk, int32_t n_trk,
+ GPS_PWay* wpt, int32_t n_wpt, int eraset)
{
GPS_PCourse* crs = nullptr;
GPS_PCourse_Lap* clp = nullptr;
GPS_PCourse_Point* cpt = nullptr;
int n_crs, n_clp=0, n_ctk=0, n_cpt=0;
int i, j, trk_end, new_crs, first_new_ctk;
- int32 ret;
+ int32_t ret;
/* Read existing courses from device */
if (eraset) {
cpt = (GPS_SCourse_Point**) xrealloc(cpt, (n_cpt+n_wpt) * sizeof(GPS_PCourse_Point));
for (i=0; i<n_wpt; i++) {
double dist, min_dist = DBL_MAX;
- uint32 min_dist_idx = 0, trk_idx = 0, min_dist_trk_idx = 0;
+ uint32_t min_dist_idx = 0, trk_idx = 0, min_dist_trk_idx = 0;
/* Find closest track point */
for (j=first_new_ctk; j<n_ctk; j++) {
}
/*Stubs for unimplemented stuff*/
-int32 GPS_Command_Get_Workout(const char* /* port */, void** /* lap */, int (* /* cb */)(int, GPS_SWay**))
+int32_t GPS_Command_Get_Workout(const char* /* port */, void** /* lap */, int (* /* cb */)(int, GPS_SWay**))
{
return 0;
}
-int32 GPS_Command_Get_Fitness_User_Profile(const char* /* port */, void** /* lap */, int (* /* cb */)(int, GPS_SWay**))
+int32_t GPS_Command_Get_Fitness_User_Profile(const char* /* port */, void** /* lap */,
+ int (* /* cb */)(int, GPS_SWay**))
{
return 0;
}
-int32 GPS_Command_Get_Workout_Limits(const char* /* port */, void** /* lap */, int (* /* cb */)(int, GPS_SWay**))
+int32_t GPS_Command_Get_Workout_Limits(const char* /* port */, void** /* lap */, int (* /* cb */)(int, GPS_SWay**))
{
return 0;
}
-int32 GPS_Command_Get_Course_Limits(const char* /* port */, void** /* lap */, int (* /* cb */)(int, GPS_SWay**))
+int32_t GPS_Command_Get_Course_Limits(const char* /* port */, void** /* lap */, int (* /* cb */)(int, GPS_SWay**))
{
return 0;
}
#include "jeeps/gps.h"
#include <ctime>
- int32 GPS_Command_Off(const char* port);
+int32_t GPS_Command_Off(const char* port);
time_t GPS_Command_Get_Time(const char* port);
- int32 GPS_Command_Send_Time(const char* port, time_t Time);
+int32_t GPS_Command_Send_Time(const char* port, time_t Time);
- int32 GPS_Command_Get_Position(const char* port, double* lat, double* lon);
- int32 GPS_Command_Send_Position(const char* port, double lat, double lon);
+int32_t GPS_Command_Get_Position(const char* port, double* lat, double* lon);
+int32_t GPS_Command_Send_Position(const char* port, double lat, double lon);
- int32 GPS_Command_Pvt_On(const char* port, gpsdevh** fd);
- int32 GPS_Command_Pvt_Off(const char* port, gpsdevh** fd);
- int32 GPS_Command_Pvt_Get(gpsdevh** fd, GPS_PPvt_Data* pvt);
+int32_t GPS_Command_Pvt_On(const char* port, gpsdevh** fd);
+int32_t GPS_Command_Pvt_Off(const char* port, gpsdevh** fd);
+int32_t GPS_Command_Pvt_Get(gpsdevh** fd, GPS_PPvt_Data* pvt);
- int32 GPS_Command_Get_Almanac(const char* port, GPS_PAlmanac** alm);
- int32 GPS_Command_Send_Almanac(const char* port, GPS_PAlmanac* alm, int32 n);
+int32_t GPS_Command_Get_Almanac(const char* port, GPS_PAlmanac** alm);
+int32_t GPS_Command_Send_Almanac(const char* port, GPS_PAlmanac* alm, int32_t n);
- int32 GPS_Command_Get_Track(const char* port, GPS_PTrack** trk, int (*cb)(int, GPS_SWay**));
- int32 GPS_Command_Send_Track(const char* port, GPS_PTrack* trk, int32 n, int eraset);
+int32_t GPS_Command_Get_Track(const char* port, GPS_PTrack** trk, int (*cb)(int, GPS_SWay**));
+int32_t GPS_Command_Send_Track(const char* port, GPS_PTrack* trk, int32_t n, int eraset);
- int32 GPS_Command_Get_Waypoint(const char* port, GPS_PWay** way,int (*cb)(int, GPS_SWay**));
- int32 GPS_Command_Send_Waypoint(const char* port, GPS_PWay* way, int32 n, int (*cb)(GPS_SWay**));
+int32_t GPS_Command_Get_Waypoint(const char* port, GPS_PWay** way, int (*cb)(int, GPS_SWay**));
+int32_t GPS_Command_Send_Waypoint(const char* port, GPS_PWay* way, int32_t n, int (*cb)(GPS_SWay**));
- int32 GPS_Command_Get_Proximity(const char* port, GPS_PWay** way);
- int32 GPS_Command_Send_Proximity(const char* port, GPS_PWay* way, int32 n);
+int32_t GPS_Command_Get_Proximity(const char* port, GPS_PWay** way);
+int32_t GPS_Command_Send_Proximity(const char* port, GPS_PWay* way, int32_t n);
- int32 GPS_Command_Get_Route(const char* port, GPS_PWay** way);
- int32 GPS_Command_Send_Route(const char* port, GPS_PWay* way, int32 n);
+int32_t GPS_Command_Get_Route(const char* port, GPS_PWay** way);
+int32_t GPS_Command_Send_Route(const char* port, GPS_PWay* way, int32_t n);
- int32 GPS_Command_Get_Lap(const char* port, GPS_PLap** lap, int (*cb)(int, GPS_SWay**));
+int32_t GPS_Command_Get_Lap(const char* port, GPS_PLap** lap, int (*cb)(int, GPS_SWay**));
- int32 GPS_Command_Send_Course(const char* port, GPS_PCourse* crs, GPS_PCourse_Lap* clp,
- GPS_PTrack* trk, GPS_PCourse_Point* cpt,
- int32 n_crs, int32 n_clp, int32 n_trk, int32 n_cpt);
- int32 GPS_Command_Send_Track_As_Course(const char* port, GPS_PTrack* trk, int32 n_trk,
- GPS_PWay* wpt, int32 n_wpt, int eraset);
+int32_t GPS_Command_Send_Course(const char* port, GPS_PCourse* crs, GPS_PCourse_Lap* clp,
+ GPS_PTrack* trk, GPS_PCourse_Point* cpt,
+ int32_t n_crs, int32_t n_clp, int32_t n_trk, int32_t n_cpt);
+int32_t GPS_Command_Send_Track_As_Course(const char* port, GPS_PTrack* trk, int32_t n_trk,
+ GPS_PWay* wpt, int32_t n_wpt, int eraset);
- int32 GPS_Command_Get_Workout(const char* port, void** lap, int (*cb)(int, GPS_SWay**));
- int32 GPS_Command_Get_Fitness_User_Profile(const char* port, void** lap, int (*cb)(int, GPS_SWay**));
- int32 GPS_Command_Get_Workout_Limits(const char* port, void** lap, int (*cb)(int, GPS_SWay**));
- int32 GPS_Command_Get_Course_Limits(const char* port, void** lap, int (*cb)(int, GPS_SWay**));
+int32_t GPS_Command_Get_Workout(const char* port, void** lap, int (*cb)(int, GPS_SWay**));
+int32_t GPS_Command_Get_Fitness_User_Profile(const char* port, void** lap, int (*cb)(int, GPS_SWay**));
+int32_t GPS_Command_Get_Workout_Limits(const char* port, void** lap, int (*cb)(int, GPS_SWay**));
+int32_t GPS_Command_Get_Course_Limits(const char* port, void** lap, int (*cb)(int, GPS_SWay**));
#endif // JEEPS_GPSCOM_H_INCLUDED_
extern gps_device_ops gps_usb_ops;
static gps_device_ops* ops = nullptr;
-int32 GPS_Device_On(const char* port, gpsdevh** fd)
+int32_t GPS_Device_On(const char* port, gpsdevh** fd)
{
gps_is_usb = (0 == case_ignore_strncmp(port, "usb:", 4));
return (ops->Device_On)(port, fd);
}
-int32 GPS_Device_Off(gpsdevh* fd)
+int32_t GPS_Device_Off(gpsdevh* fd)
{
return (ops->Device_Off)(fd);
}
-int32 GPS_Device_Wait(gpsdevh* fd)
+int32_t GPS_Device_Wait(gpsdevh* fd)
{
return (ops->Device_Wait)(fd);
}
-int32 GPS_Device_Chars_Ready(gpsdevh* fd)
+int32_t GPS_Device_Chars_Ready(gpsdevh* fd)
{
return (ops->Device_Chars_Ready)(fd);
}
-int32 GPS_Device_Flush(gpsdevh* fd)
+int32_t GPS_Device_Flush(gpsdevh* fd)
{
return (ops->Device_Flush)(fd);
}
-int32 GPS_Write_Packet(gpsdevh* fd, const GPS_Packet& packet)
+int32_t GPS_Write_Packet(gpsdevh* fd, const GPS_Packet& packet)
{
return (ops->Write_Packet)(fd, packet);
}
-int32 GPS_Packet_Read(gpsdevh* fd, GPS_Packet* packet)
+int32_t GPS_Packet_Read(gpsdevh* fd, GPS_Packet* packet)
{
return (ops->Read_Packet)(fd, packet);
}
return (ops->Get_Ack)(fd, tra, rec);
}
-void GPS_Make_Packet(GPS_Packet* packet, US type, UC* data, uint32 n)
+void GPS_Make_Packet(GPS_Packet* packet, US type, UC* data, uint32_t n)
{
packet->type = type;
if (n > 0) {
#define usecDELAY 180000 /* Microseconds before GPS sends A001 */
- int32 GPS_Device_Chars_Ready(gpsdevh* fd);
- int32 GPS_Device_On(const char* port, gpsdevh** fd);
- int32 GPS_Device_Off(gpsdevh* fd);
- int32 GPS_Device_Wait(gpsdevh* fd);
- int32 GPS_Device_Flush(gpsdevh* fd);
- int32 GPS_Device_Read(int32 ignored, void* ibuf, int size);
- int32 GPS_Device_Write(int32 ignored, const void* obuf, int size);
+int32_t GPS_Device_Chars_Ready(gpsdevh* fd);
+int32_t GPS_Device_On(const char* port, gpsdevh** fd);
+int32_t GPS_Device_Off(gpsdevh* fd);
+int32_t GPS_Device_Wait(gpsdevh* fd);
+int32_t GPS_Device_Flush(gpsdevh* fd);
+int32_t GPS_Device_Read(int32_t ignored, void* ibuf, int size);
+int32_t GPS_Device_Write(int32_t ignored, const void* obuf, int size);
void GPS_Device_Error(char* hdr, ...);
- int32 GPS_Write_Packet(gpsdevh* fd, const GPS_Packet& packet);
+int32_t GPS_Write_Packet(gpsdevh* fd, const GPS_Packet& packet);
bool GPS_Send_Ack(gpsdevh* fd, GPS_Packet* tra, GPS_Packet* rec);
- int32 GPS_Packet_Read(gpsdevh* fd, GPS_Packet* packet);
+int32_t GPS_Packet_Read(gpsdevh* fd, GPS_Packet* packet);
bool GPS_Get_Ack(gpsdevh* fd, GPS_Packet* tra, GPS_Packet* rec);
- using gps_device_op = int32 (*)(gpsdevh*);
- using gps_device_op5 = int32 (*)(const char*, gpsdevh** fd);
+ using gps_device_op = int32_t (*)(gpsdevh*);
+ using gps_device_op5 = int32_t (*)(const char*, gpsdevh** fd);
using gps_device_op10 = bool (*)(gpsdevh* fd, GPS_Packet* tra, GPS_Packet* rec);
- using gps_device_op12 = int32 (*)(gpsdevh* fd, const GPS_Packet& packet);
- using gps_device_op13 = int32 (*)(gpsdevh* fd, GPS_Packet* packet);
+ using gps_device_op12 = int32_t (*)(gpsdevh* fd, const GPS_Packet& packet);
+ using gps_device_op13 = int32_t (*)(gpsdevh* fd, GPS_Packet* packet);
typedef struct {
gps_device_op5 Device_On;
return true;
}
-static int32 gdu_on(const char* port, gpsdevh** fd)
+static int32_t gdu_on(const char* port, gpsdevh** fd)
{
return gusb_init(port, fd);
}
-static int32 gdu_off(gpsdevh* dh)
+static int32_t gdu_off(gpsdevh* dh)
{
return gusb_close(dh);
}
-static int32 gdu_read(gpsdevh* fd, GPS_Packet* packet)
+static int32_t gdu_read(gpsdevh* fd, GPS_Packet* packet)
{
/* Default is to eat bulk request packets. */
return GPS_Packet_Read_usb(fd, packet, 1);
void GPS_Fmt_Print_Time(time_t Time, FILE* outf);
void GPS_Fmt_Print_Position(double lat, double lon, FILE* outf);
void GPS_Fmt_Print_Pvt(GPS_PPvt_Data pvt, FILE* outf);
- void GPS_Fmt_Print_Almanac(GPS_PAlmanac* alm, int32 n, FILE* outf);
- void GPS_Fmt_Print_Track(GPS_PTrack* trk, int32 n, FILE* outf);
- int32 GPS_Fmt_Print_Waypoint(GPS_PWay* way, int32 n, FILE* outf);
- int32 GPS_Fmt_Print_Proximity(GPS_PWay* way, int32 n, FILE* outf);
- int32 GPS_Fmt_Print_Route(GPS_PWay* way, int32 n, FILE* outf);
+ void GPS_Fmt_Print_Almanac(GPS_PAlmanac* alm, int32_t n, FILE* outf);
+ void GPS_Fmt_Print_Track(GPS_PTrack* trk, int32_t n, FILE* outf);
+int32_t GPS_Fmt_Print_Waypoint(GPS_PWay* way, int32_t n, FILE* outf);
+int32_t GPS_Fmt_Print_Proximity(GPS_PWay* way, int32_t n, FILE* outf);
+int32_t GPS_Fmt_Print_Route(GPS_PWay* way, int32_t n, FILE* outf);
#endif // JEEPS_GPSFMT_H_INCLUDED_
#include <cstring>
-static int32 GPS_Math_LatLon_To_UTM_Param(double lat, double lon, int32* zone,
- char* zc, double* Mc, double* E0,
- double* N0, double* F0);
-static int32 GPS_Math_UTM_Param_To_Mc(int32 zone, char zc, double* Mc,
- double* E0, double* N0, double* F0);
+static int32_t GPS_Math_LatLon_To_UTM_Param(double lat, double lon, int32_t* zone,
+ char* zc, double* Mc, double* E0,
+ double* N0, double* F0);
+static int32_t GPS_Math_UTM_Param_To_Mc(int32_t zone, char zc, double* Mc,
+ double* E0, double* N0, double* F0);
** @return [void]
************************************************************************/
-void GPS_Math_Deg_To_DegMin(double v, int32* d, double* m)
+void GPS_Math_Deg_To_DegMin(double v, int32_t* d, double* m)
{
- int32 sign;
+ int32_t sign;
if (v<0.) {
v *= -1.;
sign = 0;
}
- *d = (int32)v;
+ *d = (int32_t)v;
*m = (v-(double)*d) * 60.0;
if (*m>59.999) {
++*d;
** @return [void]
************************************************************************/
-void GPS_Math_DegMin_To_Deg(int32 d, double m, double* deg)
+void GPS_Math_DegMin_To_Deg(int32_t d, double m, double* deg)
{
*deg = ((double)abs(d)) + m / 60.0;
** @return [void]
************************************************************************/
-void GPS_Math_Deg_To_DegMinSec(double v, int32* d, int32* m, double* s)
+void GPS_Math_Deg_To_DegMinSec(double v, int32_t* d, int32_t* m, double* s)
{
- int32 sign;
+ int32_t sign;
double t;
if (v<0.) {
sign = 0;
}
- *d = (int32)v;
+ *d = (int32_t)v;
t = (v -(double)*d) * 60.0;
*m = (v-(double)*d) * 60.0;
- *s = (t - (int32)t) * 60.0;
+ *s = (t - (int32_t)t) * 60.0;
if (*s>59.999) {
++t;
t = 0;
}
- *m = (int32)t;
+ *m = (int32_t)t;
if (sign) {
*d = -*d;
** @return [void]
************************************************************************/
-void GPS_Math_DegMinSec_To_Deg(int32 d, int32 m, double s, double* deg)
+void GPS_Math_DegMinSec_To_Deg(int32_t d, int32_t m, double s, double* deg)
{
*deg = ((double)abs(d)) + ((double)m + s / 60.0) / 60.0;
** @return [int32] semicircles
************************************************************************/
-int32 GPS_Math_Deg_To_Semi(double v)
+int32_t GPS_Math_Deg_To_Semi(double v)
{
return round(((double)(1U<<31) / 180.0) * v);
}
** @return [double] degrees
************************************************************************/
-double GPS_Math_Semi_To_Deg(int32 v)
+double GPS_Math_Semi_To_Deg(int32_t v)
{
return (((double)v / (double)(1U<<31)) * 180.0);
}
double phix;
double nphi;
double rho;
- int32 t1=0;
- int32 t2=0;
+ int32_t t1 = 0;
+ int32_t t2 = 0;
if (x<0.0 && y>=0.0) {
t1=1;
** @return [void]
************************************************************************/
-int32 GPS_Math_WGS84_To_Swiss_EN(double lat, double lon, double* E,
- double* N)
+int32_t GPS_Math_WGS84_To_Swiss_EN(double lat, double lon, double* E,
+ double* N)
{
const double phi0 = 46.95240556;
const double lambda0 = 7.43958333;
** @return [void]
************************************************************************/
-int32 GPS_Math_WGS84_To_ICS_EN(double lat, double lon, double* E,
- double* N)
+int32_t GPS_Math_WGS84_To_ICS_EN(double lat, double lon, double* E,
+ double* N)
{
double const phi0 = 31.73409694444; // 31 44 2.749
double const lambda0 = 35.21208055556; // 35 12 43.49
double const N0 = 1126867.909;
double phi, lambda, alt, a, b;
- int32 datum = GPS_Lookup_Datum_Index("Palestine 1923");
+ int32_t datum = GPS_Lookup_Datum_Index("Palestine 1923");
if (datum < 0) {
fatal("Unable to find Palestine 1923 in internal tables");
}
- int32 ellipse = GPS_Datum[datum].ellipse;
+ int32_t ellipse = GPS_Datum[datum].ellipse;
a = GPS_Ellipse[ellipse].a;
b = a - (a / GPS_Ellipse[ellipse].invf);
double const E0 = 170251.555;
double const N0 = 1126867.909;
double phi, lambda, alt, a, b;
- int32 datum = GPS_Lookup_Datum_Index("Palestine 1923");
+ int32_t datum = GPS_Lookup_Datum_Index("Palestine 1923");
if (datum < 0) {
fatal("Unable to find Palestine 1923 in internal tables");
}
- int32 ellipse = GPS_Datum[datum].ellipse;
+ int32_t ellipse = GPS_Datum[datum].ellipse;
a = GPS_Ellipse[ellipse].a;
b = a - (a / GPS_Ellipse[ellipse].invf);
**
** @return [int32] success
************************************************************************/
-int32 GPS_Math_EN_To_UKOSNG_Map(double E, double N, double* mE,
- double* mN, char* map)
+int32_t GPS_Math_EN_To_UKOSNG_Map(double E, double N, double* mE,
+ double* mN, char* map)
{
- int32 t;
- int32 idx;
+ int32_t t;
+ int32_t idx;
if (E>=700000. || E<0.0 || N<0.0 ||
N>=1300000.0) {
return 0;
}
- idx = ((int32)N/100000)*7 + (int32)E/100000;
+ idx = ((int32_t)N/100000)*7 + (int32_t)E/100000;
(void) strcpy(map,UKNG[idx]);
- t = ((int32)E / 100000) * 100000;
+ t = ((int32_t)E / 100000) * 100000;
*mE = E - (double)t;
- t = ((int32)N / 100000) * 100000;
+ t = ((int32_t)N / 100000) * 100000;
*mN = N - (double)t;
return 1;
**
** @return [int32] success
************************************************************************/
-int32 GPS_Math_UKOSNG_Map_To_EN(const char* map, double mapE, double mapN,
- double* E, double* N)
+int32_t GPS_Math_UKOSNG_Map_To_EN(const char* map, double mapE, double mapN,
+ double* E, double* N)
{
- int32 t;
- int32 idx;
+ int32_t t;
+ int32_t idx;
if (mapE>=100000.0 || mapE<0.0 || mapN<0.0 ||
mapN>100000.0) {
************************************************************************/
void GPS_Math_Known_Datum_To_WGS84_M(double Sphi, double Slam, double SH,
double* Dphi, double* Dlam, double* DH,
- int32 n)
+ int32_t n)
{
double Sa;
double Sif;
double x;
double y;
double z;
- int32 idx;
+ int32_t idx;
Da = 6378137.0;
Dif = 298.257223563;
************************************************************************/
void GPS_Math_WGS84_To_Known_Datum_M(double Sphi, double Slam, double SH,
double* Dphi, double* Dlam, double* DH,
- int32 n)
+ int32_t n)
{
double Sa;
double Sif;
double x;
double y;
double z;
- int32 idx;
+ int32_t idx;
Sa = 6378137.0;
Sif = 298.257223563;
************************************************************************/
void GPS_Math_Known_Datum_To_WGS84_C(double Sphi, double Slam, double SH,
double* Dphi, double* Dlam, double* DH,
- int32 n)
+ int32_t n)
{
double Sa;
double Sif;
double x;
double y;
double z;
- int32 idx;
+ int32_t idx;
double sx;
double sy;
double sz;
************************************************************************/
void GPS_Math_WGS84_To_Known_Datum_C(double Sphi, double Slam, double SH,
double* Dphi, double* Dlam, double* DH,
- int32 n)
+ int32_t n)
{
double Sa;
double Sif;
double x;
double y;
double z;
- int32 idx;
+ int32_t idx;
double Sb;
double Db;
double dx;
************************************************************************/
void GPS_Math_Known_Datum_To_Known_Datum_M(double Sphi, double Slam, double SH,
double* Dphi, double* Dlam,
- double* DH, int32 n1, int32 n2)
+ double* DH, int32_t n1, int32_t n2)
{
double Sa;
double Sif;
double y;
double z;
- int32 idx1;
- int32 idx2;
+ int32_t idx1;
+ int32_t idx2;
idx1 = GPS_Datum[n1].ellipse;
************************************************************************/
void GPS_Math_Known_Datum_To_Known_Datum_C(double Sphi, double Slam, double SH,
double* Dphi, double* Dlam,
- double* DH, int32 n1, int32 n2)
+ double* DH, int32_t n1, int32_t n2)
{
double Sa;
double Sif;
double y2;
double z2;
- int32 idx1;
- int32 idx2;
+ int32_t idx1;
+ int32_t idx2;
double Sb;
double Db;
**
** @return [int32] success
************************************************************************/
-int32 GPS_Math_WGS84_To_UKOSMap_M(double lat, double lon, double* mE,
- double* mN, char* map)
+int32_t GPS_Math_WGS84_To_UKOSMap_M(double lat, double lon, double* mE,
+ double* mN, char* map)
{
double alat;
double alon;
**
** @return [int32] success
************************************************************************/
-int32 GPS_Math_UKOSMap_To_WGS84_M(const char* map, double mE, double mN,
- double* lat, double* lon)
+int32_t GPS_Math_UKOSMap_To_WGS84_M(const char* map, double mE, double mN,
+ double* lat, double* lon)
{
double E;
double N;
**
** @return [int32] success
************************************************************************/
-int32 GPS_Math_WGS84_To_UKOSMap_C(double lat, double lon, double* mE,
- double* mN, char* map)
+int32_t GPS_Math_WGS84_To_UKOSMap_C(double lat, double lon, double* mE,
+ double* mN, char* map)
{
double alat;
double alon;
**
** @return [int32] success
************************************************************************/
-int32 GPS_Math_UKOSMap_To_WGS84_C(const char* map, double mE, double mN,
- double* lat, double* lon)
+int32_t GPS_Math_UKOSMap_To_WGS84_C(const char* map, double mE, double mN,
+ double* lat, double* lon)
{
double E;
double N;
**
** @return [int32] success
************************************************************************/
-static int32 GPS_Math_LatLon_To_UTM_Param(double lat, double lon, int32* zone,
- char* zc, double* Mc, double* E0,
- double* N0, double* F0)
+static int32_t GPS_Math_LatLon_To_UTM_Param(double lat, double lon, int32_t* zone,
+ char* zc, double* Mc, double* E0,
+ double* N0, double* F0)
{
- int32 ilon;
- int32 ilat;
+ int32_t ilon;
+ int32_t ilat;
bool psign;
bool lsign;
psign=true;
}
- ilon = abs((int32)lon);
- ilat = abs((int32)lat);
+ ilon = abs((int32_t)lon);
+ ilat = abs((int32_t)lat);
if (!lsign) {
*zone = 31 + (ilon / 6);
**
** @return [int32] success
************************************************************************/
-int32 GPS_Math_NAD83_To_UTM_EN(double lat, double lon, double* E,
- double* N, int32* zone, char* zc)
+int32_t GPS_Math_NAD83_To_UTM_EN(double lat, double lon, double* E,
+ double* N, int32_t* zone, char* zc)
{
double phi0;
double lambda0;
**
** @return [int32] success
************************************************************************/
-int32 GPS_Math_WGS84_To_UTM_EN(double lat, double lon, double* E,
- double* N, int32* zone, char* zc)
+int32_t GPS_Math_WGS84_To_UTM_EN(double lat, double lon, double* E,
+ double* N, int32_t* zone, char* zc)
{
double phi;
double lambda;
**
** @return [int32] success
************************************************************************/
-static int32 GPS_Math_UTM_Param_To_Mc(int32 zone, char zc, double* Mc,
- double* E0, double* N0, double* F0)
+static int32_t GPS_Math_UTM_Param_To_Mc(int32_t zone, char zc, double* Mc,
+ double* E0, double* N0, double* F0)
{
if (zone>60 || zone<0 || zc<'C' || zc>'X' || zc=='I' || zc=='O') {
**
** @return [int32] success
************************************************************************/
-int32 GPS_Math_UTM_EN_To_NAD83(double* lat, double* lon, double E,
- double N, int32 zone, char zc)
+int32_t GPS_Math_UTM_EN_To_NAD83(double* lat, double* lon, double E,
+ double N, int32_t zone, char zc)
{
return GPS_Math_UTM_EN_To_Known_Datum(lat, lon, E, N, zone, zc, 77);
}
**
** @return [int32] success
************************************************************************/
-int32 GPS_Math_UTM_EN_To_WGS84(double* lat, double* lon, double E,
- double N, int32 zone, char zc)
+int32_t GPS_Math_UTM_EN_To_WGS84(double* lat, double* lon, double E,
+ double N, int32_t zone, char zc)
{
double lambda0;
double N0;
**
** @return [int32] success
************************************************************************/
-int32 GPS_Math_Known_Datum_To_UTM_EN(double lat, double lon, double* E,
- double* N, int32* zone, char* zc, const int n)
+int32_t GPS_Math_Known_Datum_To_UTM_EN(double lat, double lon, double* E,
+ double* N, int32_t* zone, char* zc, const int n)
{
double phi0;
double lambda0;
double F0;
double a;
double b;
- int32 idx;
+ int32_t idx;
if (!GPS_Math_LatLon_To_UTM_Param(lat,lon,zone,zc,&lambda0,&E0,
&N0,&F0)) {
**
** @return [int32] success
************************************************************************/
-int32 GPS_Math_UTM_EN_To_Known_Datum(double* lat, double* lon, double E,
- double N, int32 zone, char zc, const int n)
+int32_t GPS_Math_UTM_EN_To_Known_Datum(double* lat, double* lon, double E,
+ double N, int32_t zone, char zc, const int n)
{
double lambda0;
double N0;
/********************************************************************/
-int32 GPS_Lookup_Datum_Index(const char* n)
+int32_t GPS_Lookup_Datum_Index(const char* n)
{
GPS_PDatum dp;
GPS_PDatum_Alias al;
return -1;
}
-int32 GPS_Lookup_Datum_Index(const QString& n)
+int32_t GPS_Lookup_Datum_Index(const QString& n)
{
return GPS_Lookup_Datum_Index(CSTR(n));
}
double GPS_Math_Metres_To_Feet(double v);
double GPS_Math_Feet_To_Metres(double v);
- int32 GPS_Math_Deg_To_Semi(double v);
- double GPS_Math_Semi_To_Deg(int32 v);
+int32_t GPS_Math_Deg_To_Semi(double v);
+ double GPS_Math_Semi_To_Deg(int32_t v);
time_t GPS_Math_Utime_To_Gtime(time_t v);
time_t GPS_Math_Gtime_To_Utime(time_t v);
- void GPS_Math_Deg_To_DegMin(double v, int32* d, double* m);
- void GPS_Math_DegMin_To_Deg(int32 d, double m, double* deg);
- void GPS_Math_Deg_To_DegMinSec(double v, int32* d, int32* m, double* s);
- void GPS_Math_DegMinSec_To_Deg(int32 d, int32 m, double s, double* deg);
+ void GPS_Math_Deg_To_DegMin(double v, int32_t* d, double* m);
+ void GPS_Math_DegMin_To_Deg(int32_t d, double m, double* deg);
+ void GPS_Math_Deg_To_DegMinSec(double v, int32_t* d, int32_t* m, double* s);
+ void GPS_Math_DegMinSec_To_Deg(int32_t d, int32_t m, double s, double* deg);
void GPS_Math_Airy1830LatLonToNGEN(double phi, double lambda, double* E,
double* N);
void GPS_Math_Airy1830M_LatLonToINGEN(double phi, double lambda, double* E,
double* N);
- int32 GPS_Math_EN_To_UKOSNG_Map(double E, double N, double* mE,
- double* mN, char* map);
- int32 GPS_Math_UKOSNG_Map_To_EN(const char* map, double mapE, double mapN,
- double* E, double* N);
+int32_t GPS_Math_EN_To_UKOSNG_Map(double E, double N, double* mE,
+ double* mN, char* map);
+int32_t GPS_Math_UKOSNG_Map_To_EN(const char* map, double mapE, double mapN,
+ double* E, double* N);
void GPS_Math_LatLonH_To_XYZ(double phi, double lambda, double H,
double* x, double* y, double* z,
double dy, double dz);
void GPS_Math_Known_Datum_To_WGS84_M(double Sphi, double Slam, double SH,
double* Dphi, double* Dlam, double* DH,
- int32 n);
+ int32_t n);
void GPS_Math_WGS84_To_Known_Datum_M(double Sphi, double Slam, double SH,
double* Dphi, double* Dlam, double* DH,
- int32 n);
+ int32_t n);
void GPS_Math_Known_Datum_To_WGS84_C(double Sphi, double Slam, double SH,
double* Dphi, double* Dlam, double* DH,
- int32 n);
+ int32_t n);
void GPS_Math_WGS84_To_Known_Datum_C(double Sphi, double Slam, double SH,
double* Dphi, double* Dlam, double* DH,
- int32 n);
+ int32_t n);
void GPS_Math_Known_Datum_To_Known_Datum_M(double Sphi, double Slam, double SH,
double* Dphi, double* Dlam,
- double* DH, int32 n1, int32 n2);
+ double* DH, int32_t n1, int32_t n2);
void GPS_Math_Known_Datum_To_Known_Datum_C(double Sphi, double Slam, double SH,
double* Dphi, double* Dlam,
- double* DH, int32 n1, int32 n2);
+ double* DH, int32_t n1, int32_t n2);
- int32 GPS_Math_WGS84_To_UKOSMap_M(double lat, double lon, double* mE,
+int32_t GPS_Math_WGS84_To_UKOSMap_M(double lat, double lon, double* mE,
double* mN, char* map);
- int32 GPS_Math_UKOSMap_To_WGS84_M(const char* map, double mE, double mN,
+int32_t GPS_Math_UKOSMap_To_WGS84_M(const char* map, double mE, double mN,
double* lat, double* lon);
- int32 GPS_Math_WGS84_To_UKOSMap_C(double lat, double lon, double* mE,
+int32_t GPS_Math_WGS84_To_UKOSMap_C(double lat, double lon, double* mE,
double* mN, char* map);
- int32 GPS_Math_UKOSMap_To_WGS84_C(const char* map, double mE, double mN,
+int32_t GPS_Math_UKOSMap_To_WGS84_C(const char* map, double mE, double mN,
double* lat, double* lon);
- int32 GPS_Math_NAD83_To_UTM_EN(double lat, double lon, double* E,
- double* N, int32* zone, char* zc);
- int32 GPS_Math_WGS84_To_UTM_EN(double lat, double lon, double* E,
- double* N, int32* zone, char* zc);
+int32_t GPS_Math_NAD83_To_UTM_EN(double lat, double lon, double* E,
+ double* N, int32_t* zone, char* zc);
+int32_t GPS_Math_WGS84_To_UTM_EN(double lat, double lon, double* E,
+ double* N, int32_t* zone, char* zc);
- int32 GPS_Math_UTM_EN_To_WGS84(double* lat, double* lon, double E,
- double N, int32 zone, char zc);
- int32 GPS_Math_UTM_EN_To_NAD83(double* lat, double* lon, double E,
- double N, int32 zone, char zc);
+int32_t GPS_Math_UTM_EN_To_WGS84(double* lat, double* lon, double E,
+ double N, int32_t zone, char zc);
+int32_t GPS_Math_UTM_EN_To_NAD83(double* lat, double* lon, double E,
+ double N, int32_t zone, char zc);
- int32 GPS_Math_Known_Datum_To_UTM_EN(double lat, double lon, double* E,
- double* N, int32* zone, char* zc, int n);
- int32 GPS_Math_UTM_EN_To_Known_Datum(double* lat, double* lon, double E,
- double N, int32 zone, char zc, int n);
+int32_t GPS_Math_Known_Datum_To_UTM_EN(double lat, double lon, double* E,
+ double* N, int32_t* zone, char* zc, int n);
+int32_t GPS_Math_UTM_EN_To_Known_Datum(double* lat, double* lon, double E,
+ double N, int32_t zone, char zc, int n);
void GPS_Math_Swiss_LatLon_To_EN(double phi, double lambda, double* E,
double* N,double phi0,double lambda0,
double* lambda, double phi0, double M0,
double E0, double N0, double a, double b);
- int32 GPS_Math_WGS84_To_ICS_EN(double lat, double lon, double* E,
+int32_t GPS_Math_WGS84_To_ICS_EN(double lat, double lon, double* E,
double* N);
void GPS_Math_ICS_EN_To_WGS84(double E, double N, double* lat, double* lon);
- int32 GPS_Math_WGS84_To_Swiss_EN(double phi, double lambda, double* E, double* N);
+int32_t GPS_Math_WGS84_To_Swiss_EN(double phi, double lambda, double* E, double* N);
void GPS_Math_Swiss_EN_To_WGS84(double E, double N, double* lat, double* lon);
void GPS_Math_UTM_EN_to_LatLon(int ReferenceEllipsoid,
double* Lat, double* Lon,
double lambda0, double E0, double N0);
- int32 GPS_Lookup_Datum_Index(const char* n);
- int32 GPS_Lookup_Datum_Index(const QString& n);
+int32_t GPS_Lookup_Datum_Index(const char* n);
+int32_t GPS_Lookup_Datum_Index(const QString& n);
const char* GPS_Math_Get_Datum_Name(int datum_index);
#endif // JEEPS_GPSMATH_H_INCLUDED_
GPS_PWay GPS_Way_New()
{
GPS_PWay ret;
- int32 i;
+ int32_t i;
if (!(ret=(GPS_PWay)xcalloc(sizeof(GPS_OWay),1))) {
perror("malloc");
typedef unsigned char UC;
typedef uint16_t US;
-typedef uint16_t uint16;
-typedef int16_t int16;
-typedef uint32_t uint32;
-typedef int32_t int32;
#endif // JEEPS_GPSPORT_H_INCLUDED_
#define GPS_TAGUNK 20
/* Storage for any unknown tags */
-static int32 gps_tag_unknown[GPS_TAGUNK];
-static int32 gps_tag_data_unknown[GPS_TAGUNK];
-static int32 gps_n_tag_unknown = 0;
+static int32_t gps_tag_unknown[GPS_TAGUNK];
+static int32_t gps_tag_data_unknown[GPS_TAGUNK];
+static int32_t gps_n_tag_unknown = 0;
COMMANDDATA COMMAND_ID[2]= {
** @return [int32] Success
************************************************************************/
-int32 GPS_Protocol_Table_Set(US id)
+int32_t GPS_Protocol_Table_Set(US id)
{
- int32 i;
+ int32_t i;
US v;
i=0;
void GPS_Unknown_Protocol_Print()
{
- int32 i;
+ int32_t i;
(void) fprintf(stdout,"\nUnknown protocols: ");
if (!gps_n_tag_unknown) {
#define pA010 10
#define pA011 11
- COMMON int32 gps_device_command;
+ COMMON int32_t gps_device_command;
struct COMMANDDATA {
* Waypoint Transfer Protocol
*/
#define pA100 100
- COMMON int32 gps_waypt_transfer;
+ COMMON int32_t gps_waypt_transfer;
/*
* Waypoint category transfer protocol
*/
#define pA101 101
- COMMON int32 gps_category_transfer;
+ COMMON int32_t gps_category_transfer;
/*
* Route Transfer Protocol
*/
#define pA200 200
#define pA201 201
- COMMON int32 gps_route_transfer;
+ COMMON int32_t gps_route_transfer;
/*
* Track Log Transfer Protocol
#define pA301 301
#define pA302 302
#define pA304 304
- COMMON int32 gps_trk_transfer;
+ COMMON int32_t gps_trk_transfer;
/*
* Proximity Waypoint Transfer Protocol
*/
#define pA400 400
- COMMON int32 gps_prx_waypt_transfer;
+ COMMON int32_t gps_prx_waypt_transfer;
/*
* Almanac Transfer Protocol
*/
#define pA500 500
- COMMON int32 gps_almanac_transfer;
+ COMMON int32_t gps_almanac_transfer;
/*
* Date Time Transfer
*/
#define pA600 600
- COMMON int32 gps_date_time_transfer;
+ COMMON int32_t gps_date_time_transfer;
/*
* FlightBook Transfer Protocol
* Position
*/
#define pA700 700
- COMMON int32 gps_position_transfer;
+ COMMON int32_t gps_position_transfer;
/*
* Pvt
*/
#define pA800 800
- COMMON int32 gps_pvt_transfer;
+ COMMON int32_t gps_pvt_transfer;
/*
* Lap Data Transfer
*/
#define pA906 906
- COMMON int32 gps_lap_transfer;
+ COMMON int32_t gps_lap_transfer;
/*
* Various fitness related
*/
#define pA1000 1000
- COMMON int32 gps_run_transfer;
+ COMMON int32_t gps_run_transfer;
#define pA1002 1002
- COMMON int32 gps_workout_transfer;
+ COMMON int32_t gps_workout_transfer;
#define pA1004 1004
- COMMON int32 gps_user_profile_transfer;
+ COMMON int32_t gps_user_profile_transfer;
#define pA1005 1005
- COMMON int32 gps_workout_limits_transfer;
+ COMMON int32_t gps_workout_limits_transfer;
#define pA1006 1006
- COMMON int32 gps_course_transfer;
+ COMMON int32_t gps_course_transfer;
#define pA1007 1007
- COMMON int32 gps_course_lap_transfer;
+ COMMON int32_t gps_course_lap_transfer;
#define pA1008 1008
- COMMON int32 gps_course_point_transfer;
+ COMMON int32_t gps_course_point_transfer;
#define pA1009 1009
- COMMON int32 gps_course_limits_transfer;
+ COMMON int32_t gps_course_limits_transfer;
#define pA1012 1012
- COMMON int32 gps_course_trk_transfer;
+ COMMON int32_t gps_course_trk_transfer;
/*
* Waypoint D Type
#define pD154 154
#define pD155 155
- COMMON int32 gps_rte_type;
- COMMON int32 gps_waypt_type;
+ COMMON int32_t gps_rte_type;
+ COMMON int32_t gps_waypt_type;
/*
* Waypoint category types
*/
#define pD120 120
- COMMON int32 gps_category_type;
+ COMMON int32_t gps_category_type;
/*
* Rte Header Type
#define pD200 200
#define pD201 201
#define pD202 202
- COMMON int32 gps_rte_hdr_type;
+ COMMON int32_t gps_rte_hdr_type;
/*
* Rte Link Type
*/
#define pD210 210
- COMMON int32 gps_rte_link_type;
+ COMMON int32_t gps_rte_link_type;
/*
#define pD302 302
#define pD303 303
#define pD304 304
- COMMON int32 gps_trk_type;
- COMMON int32 gps_run_crs_trk_type;
+ COMMON int32_t gps_trk_type;
+ COMMON int32_t gps_run_crs_trk_type;
/*
#define pD310 310
#define pD311 311
#define pD312 312
- COMMON int32 gps_trk_hdr_type;
- COMMON int32 gps_run_crs_trk_hdr_type;
+ COMMON int32_t gps_trk_hdr_type;
+ COMMON int32_t gps_run_crs_trk_hdr_type;
#define pD403 403
#define pD450 450
- COMMON int32 gps_prx_waypt_type;
+ COMMON int32_t gps_prx_waypt_type;
/*
#define pD550 550
#define pD551 551
- COMMON int32 gps_almanac_type;
+ COMMON int32_t gps_almanac_type;
/*
*/
#define pD600 600
- COMMON int32 gps_date_time_type;
+ COMMON int32_t gps_date_time_type;
*/
#define pD700 700
- COMMON int32 gps_position_type;
+ COMMON int32_t gps_position_type;
*/
#define pD800 800
- COMMON int32 gps_pvt_type;
+ COMMON int32_t gps_pvt_type;
/*
* Lap Data Type
#define pD1011 1011
#define pD1015 1015
- COMMON int32 gps_lap_type;
+ COMMON int32_t gps_lap_type;
/*
* Various fitness related
#define pD1000 1000
#define pD1009 1009
#define pD1010 1010
- COMMON int32 gps_run_type;
+ COMMON int32_t gps_run_type;
#define pD1002 1002
#define pD1008 1008
- COMMON int32 gps_workout_type;
+ COMMON int32_t gps_workout_type;
#define pD1003 1003
- COMMON int32 gps_workout_occurrence_type;
+ COMMON int32_t gps_workout_occurrence_type;
#define pD1004 1004
- COMMON int32 gps_user_profile_type;
+ COMMON int32_t gps_user_profile_type;
#define pD1005 1005
- COMMON int32 gps_workout_limits_type;
+ COMMON int32_t gps_workout_limits_type;
#define pD1006 1006
- COMMON int32 gps_course_type;
+ COMMON int32_t gps_course_type;
#define pD1007 1007
- COMMON int32 gps_course_lap_type;
+ COMMON int32_t gps_course_lap_type;
#define pD1012 1012
- COMMON int32 gps_course_point_type;
+ COMMON int32_t gps_course_point_type;
#define pD1013 1013
- COMMON int32 gps_course_limits_type;
+ COMMON int32_t gps_course_limits_type;
/*
* Link protocol type
#define pL001 1
#define pL002 2
- COMMON int32 gps_link_type;
+ COMMON int32_t gps_link_type;
struct GPS_MODEL_PROTOCOL {
US id;
- int32 link;
- int32 command;
- int32 wayptt;
- int32 wayptd;
- int32 rtea;
- int32 rted0;
- int32 rted1;
- int32 trka;
- int32 trkd;
- int32 prxa;
- int32 prxd;
- int32 alma;
- int32 almd;
+ int32_t link;
+ int32_t command;
+ int32_t wayptt;
+ int32_t wayptd;
+ int32_t rtea;
+ int32_t rted0;
+ int32_t rted1;
+ int32_t trka;
+ int32_t trkd;
+ int32_t prxa;
+ int32_t prxd;
+ int32_t alma;
+ int32_t almd;
};
US GPS_Protocol_Version_Change(US id, US version);
- COMMON int32 GPS_Protocol_Table_Set(US id);
+ COMMON int32_t GPS_Protocol_Table_Set(US id);
void GPS_Protocol_Error(US tag, US data);
void GPS_Unknown_Protocol_Print();
** @return [int32] number of bytes read
**********************************************************************/
-int32 GPS_Serial_Packet_Read(gpsdevh* fd, GPS_Packet* packet)
+int32_t GPS_Serial_Packet_Read(gpsdevh* fd, GPS_Packet* packet)
{
time_t start;
- int32 len = 0;
+ int32_t len = 0;
UC u;
UC* p;
UC chk = 0, chk_read;
#include "jeeps/gps.h"
time_t GPS_Time_Now();
- int32 GPS_Serial_Packet_Read(gpsdevh* fd, GPS_Packet* packet);
+int32_t GPS_Serial_Packet_Read(gpsdevh* fd, GPS_Packet* packet);
bool GPS_Serial_Get_Ack(gpsdevh *fd, GPS_Packet *tra, GPS_Packet *rec);
#endif // JEEPS_GPSREAD_H_INCLUDED_
#include "jeeps/gps.h"
-static int32 GPS_A600_Rqst(gpsdevh* fd, time_t Time);
-static int32 GPS_A700_Rqst(gpsdevh* fd, double lat, double lon);
+static int32_t GPS_A600_Rqst(gpsdevh* fd, time_t Time);
+static int32_t GPS_A700_Rqst(gpsdevh* fd, double lat, double lon);
** @return [int32] true if OK
************************************************************************/
-int32 GPS_Rqst_Send_Time(gpsdevh* fd, time_t Time)
+int32_t GPS_Rqst_Send_Time(gpsdevh* fd, time_t Time)
{
time_t ret=0;
**
** @return [int32] success
************************************************************************/
-static int32 GPS_A600_Rqst(gpsdevh* fd, time_t Time)
+static int32_t GPS_A600_Rqst(gpsdevh* fd, time_t Time)
{
GPS_Packet tra;
GPS_Packet rec;
** @return [int32] success
************************************************************************/
-int32 GPS_Rqst_Send_Position(gpsdevh* fd, double lat, double lon)
+int32_t GPS_Rqst_Send_Position(gpsdevh* fd, double lat, double lon)
{
- int32 ret=0;
+ int32_t ret = 0;
switch (gps_position_transfer) {
case pA700:
**
** @return [int32] success
************************************************************************/
-static int32 GPS_A700_Rqst(gpsdevh* fd, double lat, double lon)
+static int32_t GPS_A700_Rqst(gpsdevh* fd, double lat, double lon)
{
GPS_Packet tra;
GPS_Packet rec;
#include "jeeps/gps.h"
- int32 GPS_Rqst_Send_Time(gpsdevh* fd, time_t Time);
- int32 GPS_Rqst_Send_Position(gpsdevh* fd, double lat, double lon);
+int32_t GPS_Rqst_Send_Time(gpsdevh* fd, time_t Time);
+int32_t GPS_Rqst_Send_Position(gpsdevh* fd, double lat, double lon);
#endif // JEEPS_GPSRQST_H_INCLUDED_
chk -= in.n;
- for (uint32 i = 0; i < in.n; ++i) {
+ for (uint32_t i = 0; i < in.n; ++i) {
if (*p == DLE) {
++bytes;
*q++ = DLE;
** @return [int32] number of bytes in the packet
************************************************************************/
-int32 GPS_Serial_Write_Packet(gpsdevh* fd, const GPS_Packet& packet)
+int32_t GPS_Serial_Write_Packet(gpsdevh* fd, const GPS_Packet& packet)
{
- int32 ret;
+ int32_t ret;
const char* m1, *m2;
GPS_Serial_Packet ser_pkt;
UC ser_pkt_data[MAX_GPS_PACKET_SIZE * sizeof(UC)];
#define GPS_ARB_LEN 1024
- int32 GPS_Serial_Write_Packet(gpsdevh* fd, const GPS_Packet& packet);
+int32_t GPS_Serial_Write_Packet(gpsdevh* fd, const GPS_Packet& packet);
bool GPS_Serial_Send_Ack(gpsdevh* fd, GPS_Packet* tra, GPS_Packet* rec);
- void GPS_Make_Packet(GPS_Packet* packet, US type, UC* data, uint32 n);
+ void GPS_Make_Packet(GPS_Packet* packet, US type, UC* data, uint32_t n);
#endif // JEEPS_GPSSEND_H_INCLUDED_
va_end(ap);
}
-int32 GPS_Serial_On(const char* port, gpsdevh** dh)
+int32_t GPS_Serial_On(const char* port, gpsdevh** dh)
{
DCB tio;
COMMTIMEOUTS timeout;
return 1;
}
-int32 GPS_Serial_Off(gpsdevh* dh)
+int32_t GPS_Serial_Off(gpsdevh* dh)
{
win_serial_data* wsd = (win_serial_data*)dh;
CloseHandle(wsd->comport);
return 1;
}
-int32 GPS_Serial_Chars_Ready(gpsdevh* dh)
+int32_t GPS_Serial_Chars_Ready(gpsdevh* dh)
{
COMSTAT lpStat;
DWORD lpErrors;
return (lpStat.cbInQue > 0);
}
-int32 GPS_Serial_Wait(gpsdevh* fd)
+int32_t GPS_Serial_Wait(gpsdevh* fd)
{
/* Wait a short time before testing if data is ready.
* The GPS II, in particular, has a noticable time responding
return GPS_Serial_Chars_Ready(fd);
}
-int32 GPS_Serial_Flush(gpsdevh* /* fd */)
+int32_t GPS_Serial_Flush(gpsdevh* /* fd */)
{
return 1;
}
-int32 GPS_Serial_Write(gpsdevh* dh, const void* obuf, int size)
+int32_t GPS_Serial_Write(gpsdevh* dh, const void* obuf, int size)
{
win_serial_data* wsd = (win_serial_data*)dh;
DWORD len;
return len;
}
-int32 GPS_Serial_Read(gpsdevh* dh, void* ibuf, int size)
+int32_t GPS_Serial_Read(gpsdevh* dh, void* ibuf, int size)
{
DWORD cnt = 0;
win_serial_data* wsd = (win_serial_data*)dh;
// Based on information by Kolesár András from
// http://www.manualslib.com/manual/413938/Garmin-Gps-18x.html?page=32
-int32 GPS_Serial_Set_Baud_Rate(gpsdevh* fd, int br)
+int32_t GPS_Serial_Set_Baud_Rate(gpsdevh* fd, int br)
{
static UC data[4];
GPS_Packet tra;
**
** Open a serial port 8bits 1 stop bit 9600 baud
**
-** @param [w] fd [int32 *] file descriptor
+** @param [w] fd [int32_t *] file descriptor
** @param [r] port [const char *] port e.g. ttyS1
**
-** @return [int32] false upon error
+** @return [int32_t] false upon error
************************************************************************/
-int32 GPS_Serial_Open(gpsdevh* dh, const char* port)
+int32_t GPS_Serial_Open(gpsdevh* dh, const char* port)
{
struct termios tty;
if (global_opts.debug_level >= 2) fprintf(stderr, "GPS Serial Open at %d\n", gps_baud_rate);
va_end(ap);
}
-int32 GPS_Serial_Read(gpsdevh* dh, void* ibuf, int size)
+int32_t GPS_Serial_Read(gpsdevh* dh, void* ibuf, int size)
{
auto* psd = (posix_serial_data*)dh;
#if GARMULATOR
#endif
}
-int32 GPS_Serial_Write(gpsdevh* dh, const void* obuf, int size)
+int32_t GPS_Serial_Write(gpsdevh* dh, const void* obuf, int size)
{
auto* psd = (posix_serial_data*)dh;
return write(psd->fd, obuf, size);
**
** Flush the serial lines
**
-** @param [w] fd [int32] file descriptor
+** @param [w] fd [int32_t] file descriptor
**
-** @return [int32] false upon error
+** @return [int32_t] false upon error
************************************************************************/
-int32 GPS_Serial_Flush(gpsdevh* fd)
+int32_t GPS_Serial_Flush(gpsdevh* fd)
{
auto* psd = (posix_serial_data*)fd;
**
** Close serial port
**
-** @param [r] fd [int32 ] file descriptor
+** @param [r] fd [int32_t ] file descriptor
** @param [r] port [const char *] port e.g. ttyS1
**
-** @return [int32] false upon error
+** @return [int32_t] false upon error
************************************************************************/
-int32 GPS_Serial_Close(gpsdevh* fd)
+int32_t GPS_Serial_Close(gpsdevh* fd)
{
auto* psd = (posix_serial_data*)fd;
**
** Query port to see if characters are waiting to be read
**
-** @param [r] fd [int32 ] file descriptor
+** @param [r] fd [int32_t ] file descriptor
**
-** @return [int32] true if chars waiting
+** @return [int32_t] true if chars waiting
************************************************************************/
-int32 GPS_Serial_Chars_Ready(gpsdevh* dh)
+int32_t GPS_Serial_Chars_Ready(gpsdevh* dh)
{
fd_set rec;
struct timeval t;
auto* psd = (posix_serial_data*)dh;
- int32 fd = psd->fd;
+ int32_t fd = psd->fd;
#if GARMULATOR
static foo;
** appears to be around 40-50 milliseconds. Doubling the value is to
** allow some leeway.
**
-** @param [r] fd [int32 ] file descriptor
+** @param [r] fd [int32_t ] file descriptor
**
-** @return [int32] true if serial chars waiting
+** @return [int32_t] true if serial chars waiting
************************************************************************/
-int32 GPS_Serial_Wait(gpsdevh* dh)
+int32_t GPS_Serial_Wait(gpsdevh* dh)
{
fd_set rec;
struct timeval t;
** Set up port
**
** @param [r] port [const char *] port
-** @param [w] fd [int32 *] file descriptor
+** @param [w] fd [int32_t *] file descriptor
**
-** @return [int32] success
+** @return [int32_t] success
************************************************************************/
-int32 GPS_Serial_On(const char* port, gpsdevh** dh)
+int32_t GPS_Serial_On(const char* port, gpsdevh** dh)
{
auto* psd = (posix_serial_data*) xcalloc(sizeof(posix_serial_data), 1);
*dh = (gpsdevh*) psd;
** Done with port
**
** @param [r] port [const char *] port
-** @param [r] fd [int32 ] file descriptor
+** @param [r] fd [int32_t ] file descriptor
**
-** @return [int32] success
+** @return [int32_t] success
************************************************************************/
-int32 GPS_Serial_Off(gpsdevh* dh)
+int32_t GPS_Serial_Off(gpsdevh* dh)
{
if (!GPS_Serial_Close(dh)) {
// Based on information by Kolesár András from
// http://www.manualslib.com/manual/413938/Garmin-Gps-18x.html?page=32
-int32 GPS_Serial_Set_Baud_Rate(gpsdevh* fd, int br)
+int32_t GPS_Serial_Set_Baud_Rate(gpsdevh* fd, int br)
{
struct termios tty;
#define usecDELAY 180000 /* Microseconds before GPS sends A001 */
#define DEFAULT_BAUD 9600
- int32 GPS_Serial_Chars_Ready(gpsdevh* fd);
+int32_t GPS_Serial_Chars_Ready(gpsdevh* fd);
// int32 GPS_Serial_Close(int32 fd, const char *port);
// int32 GPS_Serial_Open(int32 *fd, const char *port);
// int32 GPS_Serial_Open_NMEA(int32 *fd, const char *port);
// int32 GPS_Serial_Restoretty(const char *port);
// int32 GPS_Serial_Savetty(const char *port);
- int32 GPS_Serial_On(const char* port, gpsdevh** fd);
- int32 GPS_Serial_Off(gpsdevh* fd);
- int32 GPS_Serial_Wait(gpsdevh* fd);
- int32 GPS_Serial_Flush(gpsdevh* fd);
+int32_t GPS_Serial_On(const char* port, gpsdevh** fd);
+int32_t GPS_Serial_Off(gpsdevh* fd);
+int32_t GPS_Serial_Wait(gpsdevh* fd);
+int32_t GPS_Serial_Flush(gpsdevh* fd);
// int32 GPS_Serial_On_NMEA(const char *port, gpsdevh **fd);
- int32 GPS_Serial_Read(gpsdevh* fd, void* ibuf, int size);
- int32 GPS_Serial_Write(gpsdevh* fd, const void* obuf, int size);
+int32_t GPS_Serial_Read(gpsdevh* fd, void* ibuf, int size);
+int32_t GPS_Serial_Write(gpsdevh* fd, const void* obuf, int size);
-int32 GPS_Serial_Set_Baud_Rate(gpsdevh* fd, int br);
+int32_t GPS_Serial_Set_Baud_Rate(gpsdevh* fd, int br);
#endif // JEEPS_GPSSERIAL_H_INCLUDED_
#ifndef JEEPS_GPSUSBINT_H_INCLUDED_
#define JEEPS_GPSUSBINT_H_INCLUDED_
-int32 GPS_Packet_Read_usb(gpsdevh* fd, GPS_Packet* packet, int eatbulk);
-int32 GPS_Write_Packet_usb(gpsdevh* fd, const GPS_Packet& packet);
+int32_t GPS_Packet_Read_usb(gpsdevh* fd, GPS_Packet* packet, int eatbulk);
+int32_t GPS_Write_Packet_usb(gpsdevh* fd, const GPS_Packet& packet);
#endif // JEEPS_GPSUSBINT_H_INCLUDED_
* Negative on error.
* 1 if read success - even if empty packet.
*/
-int32 GPS_Packet_Read_usb(gpsdevh* /*unused*/, GPS_Packet* packet, int eat_bulk)
+int32_t GPS_Packet_Read_usb(gpsdevh* /*unused*/, GPS_Packet* packet, int eat_bulk)
{
- int32 n;
- int32 payload_size;
+ int32_t n;
+ int32_t payload_size;
garmin_usb_packet pkt;
#include <cerrno>
#include <cstdio>
-int32
+int32_t
GPS_Write_Packet_usb(gpsdevh* /*unused*/, const GPS_Packet& packet)
{
garmin_usb_packet gp;
#include <cstdlib>
#include <fcntl.h>
-static int32 gps_endian_called=0;
-static int32 GPS_Little=0;
+static int32_t gps_endian_called = 0;
+static int32_t GPS_Little = 0;
-int32 gps_warning = 0;
-int32 gps_error = 0;
-int32 gps_user = 0;
-int32 gps_show_bytes = 0;
-int32 gps_errno = 0;
+int32_t gps_warning = 0;
+int32_t gps_error = 0;
+int32_t gps_user = 0;
+int32_t gps_show_bytes = 0;
+int32_t gps_errno = 0;
/* @func GPS_Util_Little ***********************************************
**
** @return [int32] true if little-endian
************************************************************************/
-int32 GPS_Util_Little()
+int32_t GPS_Util_Little()
{
static union lb {
- char chars[sizeof(int32)];
- int32 i;
+ char chars[sizeof(int32_t)];
+ int32_t i;
}
data;
{
double ret;
UC* p;
- int32 i;
+ int32_t i;
p = (UC*)&ret;
*p++ = s[i];
}
else
- for (i=0; i<(int32)sizeof(double); ++i) {
+ for (i=0; i<(int32_t)sizeof(double); ++i) {
*p++ = s[i];
}
void GPS_Util_Put_Double(UC* s, const double v)
{
- int32 i;
+ int32_t i;
const auto* p = reinterpret_cast<const UC*>(&v);
s[i] = *p++;
}
else
- for (i=0; i<(int32)sizeof(double); ++i) {
+ for (i=0; i<(int32_t)sizeof(double); ++i) {
s[i] = *p++;
}
** @return [int32] value
************************************************************************/
-int32 GPS_Util_Get_Int(const UC* s)
+int32_t GPS_Util_Get_Int(const UC* s)
{
- int32 ret;
+ int32_t ret;
UC* p;
- int32 i;
+ int32_t i;
p = (UC*)&ret;
if (!GPS_Little)
- for (i=sizeof(int32)-1; i>-1; --i) {
+ for (i=sizeof(int32_t)-1; i>-1; --i) {
*p++ = s[i];
}
else
- for (i=0; i<(int32)sizeof(int32); ++i) {
+ for (i=0; i<(int32_t)sizeof(int32_t); ++i) {
*p++ = s[i];
}
** @return [void]
************************************************************************/
-void GPS_Util_Put_Int(UC* s, const int32 v)
+void GPS_Util_Put_Int(UC* s, const int32_t v)
{
- int32 i;
+ int32_t i;
const auto* p = reinterpret_cast<const UC*>(&v);
if (!GPS_Little)
- for (i=sizeof(int32)-1; i>-1; --i) {
+ for (i=sizeof(int32_t)-1; i>-1; --i) {
s[i] = *p++;
}
else
- for (i=0; i<(int32)sizeof(int32); ++i) {
+ for (i=0; i<(int32_t)sizeof(int32_t); ++i) {
s[i] = *p++;
}
** @return [uint32] value
************************************************************************/
-uint32 GPS_Util_Get_Uint(const UC* s)
+uint32_t GPS_Util_Get_Uint(const UC* s)
{
- uint32 ret;
+ uint32_t ret;
UC* p;
- int32 i;
+ int32_t i;
p = (UC*)&ret;
if (!GPS_Little)
- for (i=sizeof(uint32)-1; i>-1; --i) {
+ for (i=sizeof(uint32_t)-1; i>-1; --i) {
*p++ = s[i];
}
else
- for (i=0; i<(int32)sizeof(uint32); ++i) {
+ for (i=0; i<(int32_t)sizeof(uint32_t); ++i) {
*p++ = s[i];
}
** @return [void]
************************************************************************/
-void GPS_Util_Put_Uint(UC* s, const uint32 v)
+void GPS_Util_Put_Uint(UC* s, const uint32_t v)
{
- int32 i;
+ int32_t i;
const auto* p = reinterpret_cast<const UC*>(&v);
if (!GPS_Little)
- for (i=sizeof(uint32)-1; i>-1; --i) {
+ for (i=sizeof(uint32_t)-1; i>-1; --i) {
s[i] = *p++;
}
else
- for (i=0; i<(int32)sizeof(uint32); ++i) {
+ for (i=0; i<(int32_t)sizeof(uint32_t); ++i) {
s[i] = *p++;
}
{
float ret;
UC* p;
- int32 i;
+ int32_t i;
p = (UC*)&ret;
*p++ = s[i];
}
else
- for (i=0; i<(int32)sizeof(float); ++i) {
+ for (i=0; i<(int32_t)sizeof(float); ++i) {
*p++ = s[i];
}
void GPS_Util_Put_Float(UC* s, const float v)
{
- int32 i;
+ int32_t i;
const auto* p = reinterpret_cast<const UC*>(&v);
s[i] = *p++;
}
else
- for (i=0; i<(int32)sizeof(float); ++i) {
+ for (i=0; i<(int32_t)sizeof(float); ++i) {
s[i] = *p++;
}
** @@
****************************************************************************/
-void GPS_Diagnose(int32 c)
+void GPS_Diagnose(int32_t c)
{
if (!gps_show_bytes) {
return;
#include "jeeps/gps.h"
- int32 GPS_Util_Little();
+int32_t GPS_Util_Little();
US GPS_Util_Get_Short(const UC* s);
void GPS_Util_Put_Short(UC* s, US v);
- int32 GPS_Util_Get_Int(const UC* s);
- void GPS_Util_Put_Int(UC* s, int32 v);
+int32_t GPS_Util_Get_Int(const UC* s);
+ void GPS_Util_Put_Int(UC* s, int32_t v);
double GPS_Util_Get_Double(const UC* s);
void GPS_Util_Put_Double(UC* s, double v);
float GPS_Util_Get_Float(const UC* s);
void GPS_Util_Put_Float(UC* s, float v);
- void GPS_Util_Canon(int32 state);
- int32 GPS_Util_Block(int32 fd, int32 state);
- void GPS_Util_Put_Uint(UC* s, uint32 v);
- uint32 GPS_Util_Get_Uint(const UC* s);
+ void GPS_Util_Canon(int32_t state);
+int32_t GPS_Util_Block(int32_t fd, int32_t state);
+ void GPS_Util_Put_Uint(UC* s, uint32_t v);
+uint32_t GPS_Util_Get_Uint(const UC* s);
void GPS_Warning(const char* s);
[[gnu::format(printf, 1, 2)]] void GPS_Error(const char* fmt, ...);
[[gnu::format(printf, 1, 2)]] void GPS_User(const char* fmt, ...);
void GPS_Disable_User();
void GPS_Enable_User();
- void GPS_Diagnose(int32 c);
+ void GPS_Diagnose(int32_t c);
[[gnu::format(printf, 1, 2)]] void GPS_Diag(const char* fmt, ...);
void GPS_Enable_Diagnose();
{
QString buff;
double latitude, longitude;
- int32 utmz;
+ int32_t utmz;
double utme, utmn;
char utmzc;